VirtualBox

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


Ignore:
Timestamp:
Apr 20, 2020 10:46:25 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137377
Message:

Validation Kit/Guest Additions: Added some proxy settings for Linux guests.

File:
1 edited

Legend:

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

    r83847 r83848  
    340340        fRc = False;
    341341
     342        # Additional environment block to add to the following commands.
     343        asEnv = ();
     344
     345        fNeedsProxy = True; ## @todo Make this more flexible / dynamic.
     346        sHttpProxy  = 'http://emea-proxy.uk.oracle.com:80/';
     347        sHttpsProxy = sHttpProxy;
     348
     349        if fNeedsProxy:
     350            reporter.log('Using proxy: ' + sHttpProxy);
     351            asEnv += ('http_proxy='  + sHttpProxy, 'https_proxy=' + sHttpsProxy);
     352
    342353        # Install Kernel headers, which are required for actually installing the Linux Additions.
    343354        if oTestVm.sKind.startswith('Debian') \
    344355        or oTestVm.sKind.startswith('Ubuntu'):
     356
     357            if fNeedsProxy:
     358                fRc = oTxsSession.syncMkDir("/etc/apt/apt.conf.d/", 0o755);
     359                if fRc:
     360                    fRc = oTxsSession.syncUploadString('"Acquire::http::Proxy \"' + sHttpProxy + '\"\r\n'
     361                                                       'Acquire::https::Proxy \"' + sHttpsProxy + '\"',
     362                                                       '/etc/apt/apt.conf.d/proxy.conf', 0o644);
     363                    if not fRc:
     364                        reporter.error('Unable to write to /etc/apt/apt.conf.d/proxy.conf');
     365                else:
     366                    reporter.error('Unable to create /etc/apt/apt.conf.d');
    345367
    346368            # As Ubuntu 15.10 is EOL we need to tweak the package sources by hand first in order to have a working
     
    356378                fRc = self.txsRunTest(oTxsSession, 'Updating package sources', 5 * 60 *1000,
    357379                                      '/usr/bin/apt-get', ('/usr/bin/apt-get', 'update'),
     380                                      asAddEnv = asEnv,
    358381                                      fCheckSessionStatus = True);
    359382            if fRc:
    360383                fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000,
    361384                                      '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'linux-headers-generic'),
     385                                      asAddEnv = asEnv,
    362386                                      fCheckSessionStatus = True);
    363387            if fRc:
    364388                fRc = self.txsRunTest(oTxsSession, 'Installing Guest Additions depdendencies', 5 * 60 *1000, \
    365389                                      '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'build-essential', 'perl'),
     390                                      asAddEnv = asEnv,
    366391                                      fCheckSessionStatus = True);
    367392        elif oTestVm.sKind.startswith('OL') \
     
    370395        or   oTestVm.sKind.startswith('Redhat') \
    371396        or   oTestVm.sKind.startswith('Cent'):
     397
    372398            fRc = self.txsRunTest(oTxsSession, 'Updating package sources', 5 * 60 *1000,
    373399                                               '/usr/bin/yum', ('/usr/bin/yum', 'update'),
     400                                               asAddEnv = asEnv,
    374401                                               fCheckSessionStatus = True);
    375402            if fRc:
    376403                fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000,
    377404                                      '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', 'kernel-headers'),
     405                                      asAddEnv = asEnv,
    378406                                      fCheckSessionStatus = True);
    379407            if fRc:
     
    381409                                      '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', \
    382410                                                   'make', 'automake', 'gcc', 'kernel-devel', 'dkms', 'bzip2', 'perl'),
     411                                      asAddEnv = asEnv,
    383412                                      fCheckSessionStatus = True);
    384413        else:
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