Changeset 93055 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Dec 22, 2021 1:28:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r93052 r93055 2768 2768 # For them we don't have any references anymore intentionally. 2769 2769 # 2770 reporter.log 2('Starting stale processes...');2770 reporter.log('Starting stale processes...'); 2771 2771 fRc = True; 2772 2772 for i in xrange(0, cStaleProcs): 2773 2773 try: 2774 reporter.log2('Starting stale process #%d...' % (i)); 2774 2775 oGuestSession.processCreate(sCmd, 2775 2776 asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [], … … 2786 2787 else: 2787 2788 if cProcesses != cStaleProcs: 2788 fRc = reporter.error('Got %d stale processes, expected %d ' % (cProcesses, cStaleProcs));2789 fRc = reporter.error('Got %d stale processes, expected %d (stale)' % (cProcesses, cStaleProcs)); 2789 2790 2790 2791 if fRc is True: … … 2796 2797 else: 2797 2798 asArgs = [ sCmd, '-c', 'ls -la ' + self.oTstDrv.getGuestSystemDir(oTestVm), ]; 2798 reporter.log 2('Starting non-stale processes...');2799 reporter.log('Starting non-stale processes...'); 2799 2800 aoProcesses = []; 2800 2801 for i in xrange(0, cStaleProcs): 2801 2802 try: 2803 reporter.log2('Starting non-stale process #%d...' % (i)); 2802 2804 oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2803 2805 [], [], 0); # Infinite timeout. … … 2807 2809 break; 2808 2810 2809 reporter.log 2('Waiting for non-stale processes to terminate...');2811 reporter.log('Waiting for non-stale processes to terminate...'); 2810 2812 for i, oProcess in enumerate(aoProcesses): 2811 2813 try: 2812 eWaitResult = oProcess.waitForArray([ vboxcon.ProcessWaitForFlag_Terminate, ], 120 * 1000); 2814 reporter.log('Waiting for non-stale process #%d...' % (i)); 2815 eWaitResult = oProcess.waitForArray([ vboxcon.ProcessWaitForFlag_Terminate, ], 30 * 1000); 2813 2816 eProcessStatus = oProcess.status; 2814 2817 except: … … 2825 2828 # anymore for) and the started + terminated non-stale processes (that we still keep 2826 2829 # a reference in aoProcesses[] for). 2827 if cProcesses != (cStaleProcs * 2): 2828 fRc = reporter.error('Got %d total processes, expected %d' % (cProcesses, cStaleProcs)); 2829 2830 cProcsExpected = cStaleProcs * 2; 2831 if cProcesses != cProcsExpected: 2832 fRc = reporter.error('Got %d total processes, expected %d (stale vs. non-stale)' \ 2833 % (cProcesses, cProcsExpected)); 2830 2834 if fRc is True: 2831 2835 reporter.log2('All non-stale processes terminated'); … … 2838 2842 else: 2839 2843 asArgs = [ sCmd ]; 2840 reporter.log 2('Starting blocking processes...');2844 reporter.log('Starting blocking processes...'); 2841 2845 aoProcesses = []; 2842 2846 for i in xrange(0, cStaleProcs): 2843 2847 try: 2848 reporter.log2('Starting blocking process #%d...' % (i)); 2844 2849 oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], 2845 2850 [], [], 30 * 1000); … … 2855 2860 for i, oProcess in enumerate(aoProcesses): 2856 2861 try: 2862 reporter.log('Terminating blocking process #%d...' % (i)); 2857 2863 oProcess.terminate(); 2858 2864 except: # Termination might not be supported, just skip and log it. 2859 2865 reporter.logXcpt('Termination of blocking process #%d failed, skipped:' % (i,)); 2860 2866 2861 # There still should be 20 processes because we terminated the 10 newest ones.2867 # There still should be 20 processes because we just terminated the 10 blocking ones above. 2862 2868 try: cProcesses = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes')); 2863 except: fRc = reporter.errorXcpt();2869 except: fRc = reporter.errorXcpt(); 2864 2870 else: 2865 2871 if cProcesses != (cStaleProcs * 2): 2866 fRc = reporter.error('Got %d total processes, expected %d ' % (cProcesses, cStaleProcs));2872 fRc = reporter.error('Got %d total processes, expected %d (final)' % (cProcesses, cStaleProcs)); 2867 2873 reporter.log2('Final guest session processes count: %d' % (cProcesses,)); 2868 2874 2875 if not fRc: 2876 aoProcs = self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes'); 2877 for i, oProc in enumerate(aoProcs): 2878 try: 2879 aoArgs = self.oTstDrv.oVBoxMgr.getArray(oProc, 'arguments'); 2880 reporter.log('Process %d (\'%s\') still around, status is %d' \ 2881 % (i, ' '.join([str(x) for x in aoArgs]), oProc.status)); 2882 except: 2883 reporter.logXcpt('Process lookup failed'); 2869 2884 # 2870 2885 # Now try to close the session and see what happens. 2871 2886 # 2872 reporter.log 2('Closing guest session ...');2887 reporter.log('Closing guest session ...'); 2873 2888 try: 2874 2889 oGuestSession.close();
Note:
See TracChangeset
for help on using the changeset viewer.