Exemple #1
0
 def testGetRunCommandWithProxy(self):
     FLAGS['http_proxy'].parse('http://some-proxy.com:888')
     FLAGS['https_proxy'].parse('https://some-proxy.com:888')
     cmd = maven.GetRunCommand('install')
     expected = (
         'source {} && mvn install'
         ' -Dhttp.proxyHost=some-proxy.com -Dhttp.proxyPort=888'
         ' -Dhttps.proxyHost=some-proxy.com -Dhttps.proxyPort=888'.format(
             maven.MVN_ENV_PATH))
     self.assertEqual(expected, cmd)
Exemple #2
0
def _Install(vm):
    """Installs the YCSB and, if needed, hdrhistogram package on the VM."""
    vm.Install('openjdk')
    vm.Install('curl')
    ycsb_url = (_ycsb_tar_url or FLAGS.ycsb_tar_url
                or YCSB_URL_TEMPLATE.format(FLAGS.ycsb_version))
    install_cmd = ('mkdir -p {0} && curl -L {1} | '
                   'tar -C {0} --strip-components=1 -xzf -')
    vm.RemoteCommand(install_cmd.format(YCSB_DIR, ycsb_url))
    if _GetVersionIndex(FLAGS.ycsb_version) >= 11:
        vm.Install('maven')
        vm.RemoteCommand(
            install_cmd.format(HDRHISTOGRAM_DIR, HDRHISTOGRAM_TAR_URL))
        # _JAVA_OPTIONS needed to work around this issue:
        # https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class
        vm.RemoteCommand('cd {hist_dir}; _JAVA_OPTIONS=-Djdk.net.URLClassPath.'
                         'disableClassPathURLCheck=true '
                         '{mvn_cmd} > /dev/null 2>&1'.format(
                             hist_dir=HDRHISTOGRAM_DIR,
                             mvn_cmd=maven.GetRunCommand('install')))
Exemple #3
0
 def testGetRunCommandNoProxy(self):
     FLAGS['http_proxy'].present = 0
     FLAGS['https_proxy'].present = 0
     cmd = maven.GetRunCommand('install')
     expected = ('source {} && mvn install'.format(maven.MVN_ENV_PATH))
     self.assertEqual(expected, cmd)