tdAddBasic1.py revision cf22150eaeeb72431bf1cf65c309a431454fb22b
# -*- coding: utf-8 -*-
# $Id$
"""
VirtualBox Validation Kit - Additions Basics #1.
"""
__copyright__ = \
"""
Copyright (C) 2010-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
__version__ = "$Revision$"
# Standard Python imports.
import os;
import sys;
# Only the main script needs to modify the path.
try: __file__
g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));
# Validation Kit imports.
from testdriver import reporter;
from testdriver import base;
from testdriver import vbox;
from testdriver import vboxcon;
# Sub test driver imports.
from tdAddGuestCtrl import SubTstDrvAddGuestCtrl;
"""
Additions Basics #1.
"""
## @todo
# - More of the settings stuff can e and need to be generalized!
#
#
# Overridden methods.
#
return rc;
iArg += 1;
if iArg >= len(asArgs): raise base.InvalidOption('The "--tests" takes a colon separated list of tests');
if s not in self.asTestsDef:
else:
return iArg + 1;
def actionConfig(self):
return False;
def actionExecute(self):
#
# Test execution helpers.
#
"""
Runs the specified VM thru the tests.
Returns a success indicator on the general test execution. This is not
the actual test result.
"""
sFileCdWait = 'AUTORUN.INF');
if oSession is not None:
# Do the testing.
if not fSkip:
if not fSkip:
## @todo Save an restore test.
## @todo Reset tests.
## @todo Final test: Uninstallation.
# Cleanup.
#self.terminateVmBySession(oSession)
return fRc;
"""
Tests installing the guest additions
"""
else:
#
# Verify installation of Guest Additions using commmon bits.
#
#
# Wait for the GAs to come up.
#
## @todo need to signed up for a OnAdditionsStateChanged and wait runlevel to
# at least reach Userland.
#
# Check if the additions are operational.
#
except:
return (False, oTxsSession);
# Check the additionsVersion attribute. It must not be empty.
## @todo test IAdditionsFacilities.
return (fRc, oTxsSession);
"""
Installs the Windows guest additions using the test execution service.
Since this involves rebooting the guest, we will have to create a new TXS session.
"""
asLogFile = [];
# Delete relevant log files.
sWinDir = 'C:/WinNT/';
else:
sWinDir = 'C:/Windows/';
# Install the public signing key.
## TODO
pass;
#
# The actual install.
# Enable installing the optional auto-logon modules (VBoxGINA/VBoxCredProv) + (Direct)3D support.
# Also tell the installer to produce the appropriate log files.
#
'${CDROM}/VBoxWindowsAdditions.exe', ('${CDROM}/VBoxWindowsAdditions.exe', '/S', '/l', '/with_autologon'));
# For testing the installation (D)3D stuff ('/with_d3d') we need to boot up in safe mode.
#
# Reboot the VM and reconnect the TXS session.
#
(fRc, oTxsSession) = self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, cMsTimeout = 3 * 60000);
# Add the Windows Guest Additions installer files to the files we want to download
# from the guest.
sGuestAddsDir = 'C:/Program Files/Oracle/VirtualBox Guest Additions/';
# Note: There won't be a install_ui.log because of the silent installation.
#
# Download log files.
# Ignore errors as all files above might not be present (or in different locations)
# on different Windows guests.
#
return (fRc, oTxsSession);
"""
Returns False if no version string could be obtained, otherwise True
even though errors are logged.
"""
try:
except:
return False;
return False;
reporter.error('IGuest::additionsVersion does not contain at least tree dot separated fields: "%s" (%d).'
## @todo verify the format.
return True;
"""
Do run level tests.
"""
if oTestVm.isLoggedOntoDesktop():
else:
## @todo Insert wait for the desired run level.
try:
except:
return False;
if iLevel != eExpectedRunLevel:
return True;
"""
Test guest properties.
"""
return True;
if __name__ == '__main__':