How to use is_distro_supported method in lisa

Best Python code snippet using lisa_python

power.py

Source:power.py Github

copy

Full Screen

...53 def verify_hibernation_synthetic_network(54 self, environment: Environment, log: Logger55 ) -> None:56 node = cast(RemoteNode, environment.nodes[0])57 is_distro_supported(node)58 verify_hibernation(node, log)59 @TestCaseMetadata(60 description="""61 This case is to verify vm hibernation with sriov network.62 It has the same steps with verify_hibernation_synthetic_network.63 """,64 priority=3,65 requirement=simple_requirement(66 network_interface=Sriov(),67 supported_features=[HibernationEnabled()],68 ),69 )70 def verify_hibernation_sriov_network(71 self, environment: Environment, log: Logger72 ) -> None:73 node = cast(RemoteNode, environment.nodes[0])74 is_distro_supported(node)75 verify_hibernation(node, log)76 @TestCaseMetadata(77 description="""78 This case is to verify vm time sync working after hibernation.79 Steps,80 1. Reset time using hwclock as 1 year after current date.81 2. Hibernate and resume vm.82 3. Check vm time sync correctly.83 """,84 priority=3,85 requirement=simple_requirement(86 supported_features=[HibernationEnabled()],87 ),88 )89 def verify_hibernation_time_sync(90 self, environment: Environment, log: Logger91 ) -> None:92 node = cast(RemoteNode, environment.nodes[0])93 is_distro_supported(node)94 date = node.tools[Date]95 current_date = date.current()96 newdate = current_date.replace(year=current_date.year + 1)97 hwclock = node.tools[Hwclock]98 hwclock.set_datetime(newdate)99 changed_date_before_hb = hwclock.get()100 assert_that(101 changed_date_before_hb.year - current_date.year,102 "fail to reset time",103 ).is_equal_to(1)104 verify_hibernation(node, log)105 timeout = 600106 timer = create_timer()107 while timeout > timer.elapsed(False):108 changed_date_after_hb = hwclock.get()109 if changed_date_after_hb.year == current_date.year:110 break111 time.sleep(2)112 assert_that(113 changed_date_after_hb.year,114 "after hb, timesync doesn't work",115 ).is_equal_to(current_date.year)116 @TestCaseMetadata(117 description="""118 This case is to verify hibernation with network workload.119 Steps,120 1. Run iperf3 network benchmark, make sure no issues.121 2. Hibernate and resume vm.122 3. Run iperf3 network benchmark, make sure no issues.123 """,124 priority=3,125 requirement=simple_requirement(126 min_count=2,127 supported_features=[HibernationEnabled()],128 ),129 )130 def verify_hibernation_with_network_workload(131 self, environment: Environment, log: Logger132 ) -> None:133 client_node = cast(RemoteNode, environment.nodes[0])134 is_distro_supported(client_node)135 run_network_workload(environment)136 verify_hibernation(client_node, log)137 run_network_workload(environment)138 @TestCaseMetadata(139 description="""140 This case is to verify hibernation with storage workload.141 Steps,142 1. Run fio benchmark, make sure no issues.143 2. Hibernate and resume vm.144 3. Run fio benchmark, make sure no issues.145 """,146 priority=3,147 requirement=simple_requirement(148 supported_features=[HibernationEnabled()],149 ),150 )151 def verify_hibernation_with_storage_workload(152 self, environment: Environment, log: Logger153 ) -> None:154 node = cast(RemoteNode, environment.nodes[0])155 is_distro_supported(node)156 run_storage_workload(node)157 verify_hibernation(node, log)158 run_storage_workload(node)159 @TestCaseMetadata(160 description="""161 This case is to verify hibernation with memory workload.162 Steps,163 1. Run stress-ng benchmark, make sure no issues.164 2. Hibernate and resume vm.165 3. Run stress-ng benchmark, make sure no issues.166 """,167 priority=3,168 requirement=simple_requirement(169 supported_features=[HibernationEnabled()],170 ),171 )172 def verify_hibernation_with_memory_workload(173 self, environment: Environment, log: Logger174 ) -> None:175 node = cast(RemoteNode, environment.nodes[0])176 is_distro_supported(node)177 stress_ng_tool = node.tools[StressNg]178 stress_ng_tool.launch(16, "100%", 300)179 verify_hibernation(node, log)180 stress_ng_tool.launch(16, "100%", 300)181 def after_case(self, log: Logger, **kwargs: Any) -> None:182 environment: Environment = kwargs.pop("environment")...

Full Screen

Full Screen

stress.py

Source:stress.py Github

copy

Full Screen

...36 ),37 )38 def verify_stress_hibernation(self, environment: Environment, log: Logger) -> None:39 node = cast(RemoteNode, environment.nodes[0])40 is_distro_supported(node)41 for _ in range(0, self._loop):42 verify_hibernation(node, log)43 def after_case(self, log: Logger, **kwargs: Any) -> None:44 environment: Environment = kwargs.pop("environment")...

Full Screen

Full Screen

supported_platforms.py

Source:supported_platforms.py Github

copy

Full Screen

...21 return platform.linux_distribution()[0].lower()22 except Exception:23 return platform.dist()[0].lower()24 return ''25def is_distro_supported():26 if get_distro() in SUPPORTED_DISTROS:27 return(True)28 else:...

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 lisa 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