VirtualBox

Ignore:
Timestamp:
Jan 15, 2024 8:49:12 AM (12 months ago)
Author:
vboxsync
Message:

Guest Control/Validation Kit: Added tests for user documents, user home and guest mount points.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r102076 r102871  
    25982598        return tdTestSessionEx.executeListTestSessions(aoTests, self.oTstDrv, oSession, oTxsSession, oTestVm, 'SessionEnv');
    25992599
     2600    def testGuestCtrlSessionSimple(self, oSession, oTestVm):
     2601        """
     2602        Tests simple session-based API calls.
     2603        """
     2604
     2605        reporter.log('Testing simple session-based API calls ...');
     2606
     2607        # Start a valid session.
     2608        aeWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start ];
     2609        try:
     2610            oCreds = tdCtxCreds();
     2611            oCreds.applyDefaultsIfNotSet(oTestVm);
     2612            oGuest        = oSession.o.console.guest;
     2613            oGuestSession = oGuest.createSession(oCreds.sUser, oCreds.sPassword, oCreds.sDomain, "testGuestCtrlSessionSimple");
     2614            oGuestSession.waitForArray(aeWaitFor, 30 * 1000);
     2615        except:
     2616            reporter.logXcpt('Starting session for session-based API calls failed');
     2617            return False;
     2618
     2619        fRc = True;
     2620
     2621        # User home.
     2622        if self.oTstDrv.fpApiVer >= 7.0:
     2623            reporter.log('Getting user\'s home directory ...');
     2624            try:
     2625                reporter.log('User home directory: %s' % (oGuestSession.userHome));
     2626            except:
     2627                fRc = reporter.logXcpt('Getting user home directory failed');
     2628
     2629        # User documents.
     2630        if self.oTstDrv.fpApiVer >= 7.0:
     2631            reporter.log('Getting user\'s documents directory ...');
     2632            try:
     2633                reporter.log('User documents directory: %s' % (oGuestSession.userDocuments));
     2634            except:
     2635                fRc = reporter.logXcpt('Getting user documents directory failed');
     2636
     2637        # Mount points. Only available for Guest Additions >= 7.1.
     2638        if self.oTstDrv.fpApiVer >= 7.1:
     2639            reporter.log('Getting mount points ...');
     2640            try:
     2641                aMountpoints = oGuestSession.getMountPoints();
     2642                reporter.log('Got %ld mount points' % len(aMountpoints))
     2643                for mountPoint in aMountpoints:
     2644                    reporter.log('Mountpoint: %s' % (mountPoint));
     2645            except:
     2646                fRc = reporter.logXcpt('Getting mount points failed');
     2647
     2648        # Close the session.
     2649        try:
     2650            oGuestSession.close();
     2651        except:
     2652            fRc = reporter.errorXcpt('Closing guest session failed');
     2653
     2654        return fRc;
     2655
    26002656    def testGuestCtrlSession(self, oSession, oTxsSession, oTestVm):
    26012657        """
     
    27382794
    27392795        ## @todo Test session timeouts.
     2796
     2797        fRc2 = self.testGuestCtrlSessionSimple(oSession, oTestVm);
     2798        if fRc:
     2799            fRc = fRc2;
    27402800
    27412801        return (fRc, oTxsSession);
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