Changeset 56735 in vbox
- Timestamp:
- Jul 1, 2015 2:32:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r56731 r56735 452 452 for (i, oStep) in enumerate(self.aoSteps): 453 453 fRc2 = oStep.execute(oTstDrv, oGstCtrlSession, sMsgPrefix + ', step #%d' % i); 454 if fRc2 is False: 454 if fRc2 is True: 455 pass; 456 elif fRc2 is None: 457 reporter.log('skipping remaining %d steps' % (len(self.aoSteps) - i - 1,)); 458 break; 459 else: 455 460 fRc = False; 456 461 return fRc; … … 474 479 475 480 481 class tdSessionStepBase(object): 482 """ 483 Base class for the guest control session test steps. 484 """ 485 486 def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix): 487 """ 488 Executes the test step. 489 490 Returns True on success. 491 Returns False on failure (must be reported as error). 492 Returns None if to skip the remaining steps. 493 """ 494 reporter.error('%s: Missing execute implementation: %s' % (sMsgPrefix, self,)); 495 _ = oTstDrv; 496 _ = oGstCtrlSession; 497 return False; 498 499 500 class tdStepRequireMinimumApiVer(tdSessionStepBase): 501 """ 502 Special test step which will cause executeSteps to skip the remaining step 503 if the VBox API is too old: 504 """ 505 def __init__(self, fpMinApiVer): 506 self.fpMinApiVer = fpMinApiVer; 507 508 def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix): 509 """ Returns None if API version is too old, otherwise True. """ 510 if oTstDrv.fpApiVer >= self.fpMinApiVer: 511 return True; 512 _ = oGstCtrlSession; 513 _ = sMsgPrefix; 514 return None; # Special return value. Don't use elsewhere. 515 476 516 477 517 # … … 479 519 # 480 520 481 class tdStepSessionSetEnv( object):521 class tdStepSessionSetEnv(tdSessionStepBase): 482 522 """ 483 523 Guest session environment: schedule putenv … … 521 561 return True; 522 562 523 class tdStepSessionUnsetEnv( object):563 class tdStepSessionUnsetEnv(tdSessionStepBase): 524 564 """ 525 565 Guest session environment: schedule unset. … … 562 602 return True; 563 603 564 class tdStepSessionBulkEnv( object):604 class tdStepSessionBulkEnv(tdSessionStepBase): 565 605 """ 566 606 Guest session environment: Bulk environment changes. … … 605 645 606 646 607 class tdStepSessionCheckEnv( object):647 class tdStepSessionCheckEnv(tdSessionStepBase): 608 648 """ 609 649 Check the currently scheduled environment changes of a guest control session. … … 651 691 return fRc; 652 692 693 653 694 # 654 695 # File system object statistics (i.e. stat()). 655 696 # 656 697 657 class tdStepStat( object):698 class tdStepStat(tdSessionStepBase): 658 699 """ 659 700 Stats a file system object. … … 1477 1518 tdStepSessionSetEnv('FOO', 'BAR'), 1478 1519 tdStepSessionCheckEnv(['FOO=BAR',]), 1520 tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder. 1479 1521 tdStepSessionClearEnv(), 1480 1522 tdStepSessionCheckEnv(), … … 1500 1542 tdStepSessionSetEnv('FOO','BAR3'), 1501 1543 tdStepSessionCheckEnv([ 'FOO=BAR3',]), 1544 tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder. 1502 1545 # Add a little unsetting to the mix. 1503 1546 tdStepSessionSetEnv('BAR', 'BEAR'), … … 1516 1559 tdStepSessionBulkEnv(['FOO=bar', 'foo=bar', 'FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']), 1517 1560 tdStepSessionCheckEnv(['FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']), 1561 tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy! 1562 tdStepSessionBulkEnv(['2=1+1', 'FOO=doofus2', ]), 1563 tdStepSessionCheckEnv(['2=1+1', 'FOO=doofus2', 'TMPDIR=/tmp', 'foo=bar2']), 1518 1564 ]), 1519 1565 # Invalid variable names. … … 1526 1572 tdStepSessionSetEnv('=FOO', 'BAR', vbox.ComError.E_INVALIDARG), 1527 1573 tdStepSessionCheckEnv(), 1574 tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy! 1528 1575 tdStepSessionBulkEnv(['=', 'foo=bar'], vbox.ComError.E_INVALIDARG), 1529 1576 tdStepSessionCheckEnv(),
Note:
See TracChangeset
for help on using the changeset viewer.