def tearDown(self): if not configure_network.set_mtu_host(self.iface, '1500'): self.fail("Failed to set mtu in host") if not self.peerinfo.set_mtu_peer(self.peer_interface, '1500'): self.fail("Failed to set mtu in peer") time.sleep(10) configure_network.unset_ip(self.iface)
def test_cleanup(self): ''' clean up the interface config ''' self.bond_remove("local") for val in self.host_interfaces: cmd = "ifdown %s; ifup %s" % (val, val) process.system(cmd, shell=True, ignore_status=True) for _ in range(0, 600, 60): if 'state UP' in process.system_output("ip link \ show %s" % val, shell=True).decode("utf-8"): self.log.info("Interface %s is up", val) break time.sleep(60) else: self.log.warn("Interface %s in not up\ in the host machine", val) if self.gateway: cmd = 'ip route add default via %s' % \ (self.gateway) process.system(cmd, shell=True, ignore_status=True) if self.peer_bond_needed: self.bond_remove("peer") for val in self.peer_interfaces: cmd = "ifdown %s; ifup %s; sleep %s"\ % (val, val, self.peer_wait_time) output = self.session.cmd(cmd) if not output.exit_status == 0: self.log.warn("unable to bring to original state in peer") time.sleep(self.sleep_time) self.error_check() for interface in self.host_interfaces: configure_network.unset_ip(interface)
def tearDown(self): ''' unset ip for host interface ''' if not configure_network.set_mtu_host(self.iface, '1500'): self.cancel("Failed to set mtu in host") if not self.peerinfo.set_mtu_peer(self.peer_interface, '1500'): self.cancel("Failed to set mtu in peer") configure_network.unset_ip(self.iface)
def tearDown(self): ''' Remove the files created ''' self.mtu_set_back() if 'scp' in str(self.name.name): process.run("rm -rf /tmp/tempfile") cmd = "timeout 600 ssh %s \" rm -rf /tmp/tempfile\"" % self.peer process.system(cmd, shell=True, verbose=True, ignore_status=True) configure_network.unset_ip(self.iface)
def tearDown(self): """ removing the data in peer machine """ cmd = "pkill netserver; rm -rf /tmp/%s" % self.version output = self.session.cmd(cmd) if not output.exit_status == 0: self.fail("test failed because peer sys not connected") if not configure_network.set_mtu_host(self.iface, '1500'): self.cancel("Failed to set mtu in host") if not self.peerinfo.set_mtu_peer(self.peer_interface, '1500'): self.cancel("Failed to set mtu in peer") configure_network.unset_ip(self.iface)
def tearDown(self): ''' unset ip for host interface ''' for host_interface in self.host_interfaces: if not configure_network.set_mtu_host(host_interface, '1500'): self.cancel("Failed to set mtu in host") for peer_ip in self.peer_ips: self.peer_interface = self.peerinfo.get_peer_interface(peer_ip) if not self.peerinfo.set_mtu_peer(self.peer_interface, '1500'): self.cancel("Failed to set mtu in peer") for interface in self.host_interfaces: configure_network.unset_ip(interface)
def tearDown(self): """ Killing Uperf process in peer machine """ cmd = "pkill uperf; rm -rf /tmp/uperf-master" output = self.session.cmd(cmd) if not output.exit_status == 0: self.fail("Either the ssh to peer machine machine\ failed or uperf process was not killed") if not configure_network.set_mtu_host(self.iface, '1500'): self.cancel("Failed to set mtu in host") if not self.peerinfo.set_mtu_peer(self.peer_interface, '1500'): self.cancel("Failed to set mtu in peer") configure_network.unset_ip(self.iface)
def tearDown(self): ''' Set to original state ''' self.check_failure('ip link set br0 down') self.check_failure('ip link del dev br0') self.check_failure('ip addr add %s broadcast %s dev %s' % (self.cidr, self.broadcast, self.host_interface)) self.check_failure('ip link set %s up' % self.host_interface) if self.gateway: self.check_failure('ip route add default via %s' % self.gateway) if process.system('ping %s -c 4' % self.peer_ip, shell=True, ignore_status=True): self.fail('Ping failed when restoring back to provided interface') configure_network.unset_ip(self.host_interface)
def tearDown(self): ''' delete multicast route and turn off multicast option ''' cmd = "ip route del 224.0.0.0/4" output = self.session.cmd(cmd) if not output.exit_status == 0: self.log.info("Unable to delete multicast route added for peer") cmd = "echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts" if process.system(cmd, shell=True, verbose=True, ignore_status=True) != 0: self.log.info("unable to unset all mulicast option") cmd = "ip link set %s allmulticast off" % self.iface if process.system(cmd, shell=True, verbose=True, ignore_status=True) != 0: self.log.info("unable to unset all mulicast option") configure_network.unset_ip(self.iface)
def tearDown(self): ''' Set the interface up at the end of test. ''' self.interface_state_change(self.iface, "up", "yes") configure_network.unset_ip(self.iface)
def tearDown(self): ''' unset ip address ''' configure_network.unset_ip(self.iface)
def tearDown(self): ''' unset ip for host interface ''' configure_network.unset_ip(self.iface)