Add local Windows Server inventory collection and validation; include core package
This commit is contained in:
16
tests/test_powershell.py
Normal file
16
tests/test_powershell.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import unittest
|
||||
|
||||
|
||||
class PowerShellTests(unittest.TestCase):
|
||||
def test_native_ast_and_synthetic_collectors(self):
|
||||
executable = shutil.which('powershell.exe') if os.name == 'nt' else shutil.which('pwsh')
|
||||
if not executable:
|
||||
self.skipTest('No PowerShell runtime available; native AST/collector tests require Windows PowerShell 5.1 or pwsh.')
|
||||
script=Path('tests/powershell/Test-Collectors.ps1').resolve()
|
||||
result=subprocess.run([executable,'-NoLogo','-NoProfile','-NonInteractive','-File',str(script)],capture_output=True,text=True,timeout=60,shell=False)
|
||||
self.assertEqual(result.returncode,0,result.stdout+'\n'+result.stderr)
|
||||
self.assertIn('synthetic collector tests passed',result.stdout)
|
||||
Reference in New Issue
Block a user