def test_distributed_th_hostnames(self): obj = JMeterExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": "tests/jmx/http.jmx"}}) obj.distributed_servers = ["127.0.0.1", "127.0.0.1"] obj.prepare() xml_tree = etree.fromstring(open(obj.modified_jmx, "rb").read()) thread_groups = xml_tree.findall(".//ThreadGroup") prepend_str = r"${__machineName()}" for thread_group in thread_groups: self.assertTrue( thread_group.attrib["testname"].startswith(prepend_str)) obj = JMeterExecutor() obj.engine = EngineEmul() obj.engine.config = json.loads( open(__dir__() + "/../../tests/json/get-post.json").read()) obj.execution = obj.engine.config['execution'] obj.settings.merge(obj.engine.config.get("modules").get("jmeter")) obj.distributed_servers = ["127.0.0.1", "127.0.0.1"] obj.prepare() xml_tree = etree.fromstring(open(obj.modified_jmx, "rb").read()) thread_groups = xml_tree.findall(".//ThreadGroup") prepend_str = r"${__machineName()}" for thread_group in thread_groups: self.assertFalse( thread_group.attrib["testname"].startswith(prepend_str))
def test_csv_path_bug_in_distributed_mode(self): obj = JMeterExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": "tests/jmx/files.jmx"}}) obj.distributed_servers = ["127.0.0.1", "127.0.0.1"] obj.prepare() target_jmx = os.path.join(obj.engine.artifacts_dir, "modified_files.jmx.jmx") self.__check_path_resource_files(target_jmx, exclude_jtls=True, reverse_check=True)
def test_distributed_th_hostnames(self): obj = JMeterExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": "tests/jmx/http.jmx"}}) obj.distributed_servers = ["127.0.0.1", "127.0.0.1"] obj.prepare() xml_tree = etree.fromstring(open(obj.modified_jmx, "rb").read()) thread_groups = xml_tree.findall(".//ThreadGroup") prepend_str = r"${__machineName()}" for thread_group in thread_groups: self.assertTrue(thread_group.attrib["testname"].startswith(prepend_str)) obj = JMeterExecutor() obj.engine = EngineEmul() obj.engine.config = json.loads(open(__dir__() + "/../../tests/json/get-post.json").read()) obj.execution = obj.engine.config['execution'] obj.settings.merge(obj.engine.config.get("modules").get("jmeter")) obj.distributed_servers = ["127.0.0.1", "127.0.0.1"] obj.prepare() xml_tree = etree.fromstring(open(obj.modified_jmx, "rb").read()) thread_groups = xml_tree.findall(".//ThreadGroup") prepend_str = r"${__machineName()}" for thread_group in thread_groups: self.assertFalse(thread_group.attrib["testname"].startswith(prepend_str))