How to use add_port_tag method in autotest

Best Python code snippet using autotest_python

ovs_basic.py

Source:ovs_basic.py Github

copy

Full Screen

...160 if "exception" in ret:161 test.error("VM %s can't ping host:\n %s" %162 (vm.name, ret.exception))163 error_context.context("Add OpenVSwitch device to vlan.")164 self.ovs.add_port_tag(self.mvms[0].virtnet[1].ifname, "1")165 self.ovs.add_port_tag(self.mvms[1].virtnet[1].ifname, "1")166 self.ovs.add_port_tag(self.mvms[2].virtnet[1].ifname, "2")167 self.ovs.add_port_tag(self.mvms[3].virtnet[1].ifname, "2")168 error_context.context("Ping all devices in vlan.")169 self.mvms[2].ping(self.mvms[3].virtnet[1].ip["ipv6"][0], 1, 2)170 self.mvms[3].ping(self.mvms[2].virtnet[1].ip["ipv6"][0], 1, 2)171 self.mvms[0].ping(self.mvms[1].virtnet[1].ip["ipv6"][0], 1, 1)172 self.mvms[1].ping(self.mvms[0].virtnet[1].ip["ipv6"][0], 1, 1)173 try:174 self.mvms[0].ping(self.mvms[2].virtnet[1].ip["ipv6"][0],175 1, 2)176 test.error("VM %s can't ping host:\n %s" %177 (vm.name, ret.exception))178 except (process.CmdError, aexpect.ShellError):179 pass180 self.mvms[0].add_vlan_iface(self.mvms[0].virtnet[1].g_nic_name, 1)181 self.mvms[0].add_vlan_iface(self.mvms[0].virtnet[1].g_nic_name, 2)182 self.ovs.add_port_tag(self.mvms[0].virtnet[1].ifname, "[]")183 self.ovs.add_port_trunk(self.mvms[0].virtnet[1].ifname, [1, 2])184 time.sleep(1)185 error_context.context("Ping all devices in vlan.")186 self.mvms[0].ping(self.mvms[1].virtnet[1].ip["ipv6"][0], 1,187 count, vlan=1)188 self.mvms[0].ping(self.mvms[2].virtnet[1].ip["ipv6"][0], 1,189 count, vlan=2)190 self.mvms[1].ping(self.mvms[0].virtnet[1].ip["ipv6"][0], 1,191 count)192 self.mvms[2].ping(self.mvms[0].virtnet[1].ip["ipv6"][0], 1,193 count)194 try:195 self.mvms[0].ping(self.mvms[2].virtnet[1].ip["ipv6"][0],196 1, 2)197 test.error("VM %s shouldn't be able to ping"198 " host:\n %s" % (vm.name, ret.exception))199 except (process.CmdError, aexpect.ShellError):200 pass201 for i in range(0, 4095, 10):202 self.ovs.add_port_tag(self.mvms[0].virtnet[1].ifname, "[]")203 self.ovs.add_port_trunk(self.mvms[0].virtnet[1].ifname, [i])204 self.ovs.add_port_trunk(self.mvms[0].virtnet[1].ifname,205 list(range(4095)))206 self.ovs.add_port_trunk(self.mvms[0].virtnet[1].ifname, [1])207 self.mvms[0].ping(self.mvms[1].virtnet[1].ip["ipv6"][0], 1,208 count, vlan=1)209 test_type = "test_" + params.get("test_type")210 if (test_type in locals()):211 tests_group = locals()[test_type]212 tests_group(test, params, env)213 else:214 test.fail("Test type '%s' is not defined in"...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful