VirtualBox

Changeset 83965 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Apr 24, 2020 2:07:41 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137532
Message:

Main: bugref:9341: Fixed pylint errors for testcase

File:
1 edited

Legend:

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

    r83964 r83965  
    3636import sys;
    3737import re;
    38 import struct;
    39 import time;
    4038import ssl;
    4139
     
    4341if sys.version_info[0] < 3:
    4442    import urllib2 as urllib; # pylint: disable=import-error,no-name-in-module
    45     from urllib2        import quote        as urllib_quote;        # pylint: disable=import-error,no-name-in-module
    46     from urllib         import urlencode    as urllib_urlencode;    # pylint: disable=import-error,no-name-in-module
    4743    from urllib2        import ProxyHandler as urllib_ProxyHandler; # pylint: disable=import-error,no-name-in-module
    4844    from urllib2        import build_opener as urllib_build_opener; # pylint: disable=import-error,no-name-in-module
    4945else:
    5046    import urllib; # pylint: disable=import-error,no-name-in-module
    51     from urllib.parse   import quote        as urllib_quote;        # pylint: disable=import-error,no-name-in-module
    52     from urllib.parse   import urlencode    as urllib_urlencode;    # pylint: disable=import-error,no-name-in-module
    5347    from urllib.request import ProxyHandler as urllib_ProxyHandler; # pylint: disable=import-error,no-name-in-module
    5448    from urllib.request import build_opener as urllib_build_opener; # pylint: disable=import-error,no-name-in-module
     
    281275        return True;
    282276
    283     def guestProcessExecute(self, oGuestSession, sTestName, cMsTimeout, sExecName, asArgs = (), fGetStdOut = True, fIsError = True):
     277    def guestProcessExecute(self, oGuestSession, sTestName, cMsTimeout, sExecName, asArgs = (),
     278                            fGetStdOut = True, fIsError = True):
    284279        """
    285280        Helper function to execute a program on a guest, specified in the current test.
     
    491486            if not fIgnoreErrors:
    492487                return reporter.errorXcpt('Download file failed: Could not create session for vbox');
    493             else:
    494                 reporter.log('warning: Download file failed: Could not create session for vbox');
    495                 return False;
     488            reporter.log('warning: Download file failed: Could not create session for vbox');
     489            return False;
    496490
    497491        try:
     
    708702
    709703        if fRc:
    710             (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Allowing execution for the vbox installer',
    711                                                     30 * 1000, '/usr/bin/sudo',
    712                                                     ['/usr/bin/sudo', '/bin/chmod', '755', '/tmp/' + os.path.basename(self.sTestBuild)],
    713                                                     False, True);
     704            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession,
     705                                                      'Allowing execution for the vbox installer',
     706                                                      30 * 1000, '/usr/bin/sudo',
     707                                                      ['/usr/bin/sudo', '/bin/chmod', '755',
     708                                                       '/tmp/' + os.path.basename(self.sTestBuild)],
     709                                                      False, True);
    714710        if fRc:
    715711            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox',
    716                                                     240 * 1000, '/usr/bin/sudo',
    717                                                     ['/usr/bin/sudo', '/tmp/' + os.path.basename(self.sTestBuild),], False, True);
     712                                                      240 * 1000, '/usr/bin/sudo',
     713                                                      ['/usr/bin/sudo',
     714                                                       '/tmp/' + os.path.basename(self.sTestBuild),],
     715                                                      False, True);
    718716
    719717        fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack.
     
    10471045
    10481046        # Create autostart database directory writeable for everyone
    1049         (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Setting the autostart environment variable',
    1050                                                   30 * 1000, 'C:\\Windows\\System32\\reg.exe',
    1051                                                   ['reg', 'add',
    1052                                                    'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
    1053                                                    '/v', 'VBOXAUTOSTART_CONFIG', '/d',
    1054                                                    'C:\\ProgramData\\autostart.cfg', '/f'],
    1055                                                   False, True);
     1047        (fRc, _, _, _) = \
     1048            self.guestProcessExecute(oGuestSession, 'Setting the autostart environment variable',
     1049                                     30 * 1000, 'C:\\Windows\\System32\\reg.exe',
     1050                                     ['reg', 'add',
     1051                                      'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
     1052                                      '/v', 'VBOXAUTOSTART_CONFIG', '/d',
     1053                                      'C:\\ProgramData\\autostart.cfg', '/f'],
     1054                                     False, True);
    10561055
    10571056        sVBoxCfg = self._createAutostartCfg(sDefaultPolicy, asUserAllow, asUserDeny);
     
    10701069            return fRc;
    10711070
    1072         (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName,
    1073                                                 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
    1074                                                 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 'createvm',
    1075                                                  '--name', sVmName, '--register'], False, True);
    1076         if fRc:
    1077             (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM',
    1078                                                     30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
    1079                                                     ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
    1080                                                      'modifyvm', sVmName, '--autostart-enabled', 'on'], False, True);
     1071        (fRc, _, _, _) = \
     1072            self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName,
     1073                                     30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
     1074                                     ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 'createvm',
     1075                                      '--name', sVmName, '--register'], False, True);
     1076        if fRc:
     1077            (fRc, _, _, _) = \
     1078                self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM',
     1079                                         30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
     1080                                         ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe',
     1081                                          'modifyvm', sVmName, '--autostart-enabled', 'on'], False, True);
    10811082        fRc = fRc and self.uploadString(oSession, 'password', 'C:\\ProgramData\\password.cfg');
    10821083        if fRc:
    1083             (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Install autostart service for the user',
    1084                                                     30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe',
    1085                                                     ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe',
    1086                                                      'install', '--user=' + sUser, '--password-file=C:\\ProgramData\\password.cfg'],
    1087                                                     False, True);
     1084            (fRc, _, _, _) = \
     1085                self.guestProcessExecute(oGuestSession, 'Install autostart service for the user',
     1086                                         30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe',
     1087                                         ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe',
     1088                                          'install', '--user=' + sUser,
     1089                                          '--password-file=C:\\ProgramData\\password.cfg'],
     1090                                         False, True);
    10881091        fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack.
    10891092
Note: See TracChangeset for help on using the changeset viewer.

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