def test_clientfailover(self): ''' Performs Client initiated failover for Network virtualized device ''' device_id = self.find_device_id(self.mac_id[0]) try: for _ in range(self.count): for val in range(int(self.backing_dev_count())): self.log.info( "Performing Client initiated\ failover - Attempt %s", int(val + 1)) genio.write_file_or_fail( "/sys/devices/vio/%s/failover" % device_id, "1") time.sleep(10) self.log.info("Running a ping test to check if failover \ affected Network connectivity") device = self.find_device(self.mac_id[0]) networkinterface = NetworkInterface(device, self.local) if networkinterface.ping_check(self.peer_ip[0], count=5, options="-w50") is not None: self.fail("Ping test failed. Network virtualized \ failover has affected Network connectivity") except CmdError as details: self.log.debug(str(details)) self.fail("Client initiated Failover for Network virtualized \ device has failed") self.check_dmesg_error()
def set_thp_value(feature, value): """ Sets THP feature to a given value :param feature: Thp feature to set :type feature: str :param value: Value to be set to feature :type value: str """ thp_path = "/sys/kernel/mm/transparent_hugepage/" thp_feature_to_set = os.path.join(thp_path, feature) genio.write_file_or_fail(thp_feature_to_set, value)