def assert_installed(testcase, package_filename=None): # Verify that the package file exists if package_filename is None: _, package_filename = \ SliderPrestoInstaller._detect_presto_package(testcase) si = SliderInstaller(testcase) keywords = si.get_keywords() hdfs_cmd = 'hdfs dfs -ls %s' % ( os.path.join('/', 'user', keywords[SLIDER_USER], '.slider', 'package', keywords[APPNAME], os.path.basename(package_filename)) ) testcase.cluster.exec_cmd_on_host( SliderPrestoInstaller._get_slider_master(testcase), hdfs_cmd, SliderPrestoInstaller._get_slider_user(testcase)) # Verify that slider thinks the package is installed conf = TestSliderInstallation.get_config() slider_cmd = \ "bash -c 'export HADOOP_CONF_DIR=%s ; %s package --list'" % ( conf[HADOOP_CONF], get_slider_bin(conf)) output = testcase.cluster.exec_cmd_on_host( SliderPrestoInstaller._get_slider_master(testcase), slider_cmd, user=SliderPrestoInstaller._get_slider_user(testcase)) testcase.assertRegexpMatches(output, r'\b%s\b' % (conf[APPNAME]))
def get_keywords(self): from tests.product.yarn_slider.test_slider_installation import \ TestSliderInstallation # The docker config has the external hostname for the slider master, # which is the one we need to run stuff on clusters. return TestSliderInstallation.docker_config(self.conf)
def __init__(self, testcase, override=None): from tests.product.yarn_slider.test_slider_installation import \ TestSliderInstallation self.testcase = testcase self.conf = TestSliderInstallation.get_config(override)