VirtualBox

Changeset 86558 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 13, 2020 2:20:04 PM (4 years ago)
Author:
vboxsync
Message:

Main: bugref:9341: Testcase: fixed invalid matching string in the script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py

    r86556 r86558  
    12271227        if fRc:
    12281228            sSecPolicyEditor = """
    1229 $oUser = New-Object System.Security.Principal.NTAccount("%s")
     1229$sUser = '%s'
     1230$oUser = New-Object System.Security.Principal.NTAccount("$sUser")
    12301231$oSID = $oUser.Translate([System.Security.Principal.SecurityIdentifier])
    1231 $sExportFile = '.\\cfg.inf'
    1232 $sSecDb = '.\\secedt.sdb'
    1233 $sSecDb1 = '.\\secedt.jfm'
    1234 $sImportFile = '.\\newcfg.inf'
     1232$sExportFile = 'C:\\Temp\\cfg.inf'
     1233$sSecDb = 'C:\\Temp\\secedt.sdb'
     1234$sImportFile = 'C:\\Temp\\newcfg.inf'
    12351235secedit /export /cfg $sExportFile
    12361236$sCurrServiceLogonRight = Get-Content -Path $sExportFile |
    1237     Where-Object -FilterScript {$PSItem -match 'SeServiceLogonRight'}
     1237    Where-Object {$_ -Match 'SeServiceLogonRight'}
    12381238$asFileContent = @'
    12391239[Unicode]
     
    12591259Remove-Item -Path $sSecDb
    12601260Remove-Item -Path $sImportFile
    1261 Remove-Item -Path $sSecDb1
    12621261                           """ % (sUser,);
    12631262            fRc = self.uploadString(oGuestSession, sSecPolicyEditor, 'C:\\Temp\\adjustsec.ps1');
     
    12671266            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession,
    12681267                                                      'Setting the "Logon as service" policy to the user %s' % sUser,
    1269                                                       60 * 1000, 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe',
    1270                                                       ['powershell.exe', '-file', 'C:\\Temp\\adjustsec.ps1', '-ExecutionPolicy',
    1271                                                        'Bypass' ], False, True);
     1268                                                      300 * 1000, 'C:\\Windows\\System32\\cmd.exe',
     1269                                                      ['cmd.exe', '/c', "type C:\\Temp\\adjustsec.ps1 | powershell -"],
     1270                                                      False, True);
    12721271            if not fRc:
    12731272                reporter.error('Setting the "Logon as service" policy to the user %s failed' % sUser);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette