diff --git a/py-scripts/example_open_connection.py b/py-scripts/example_open_connection.py index 27b83569..2b0ef99e 100755 --- a/py-scripts/example_open_connection.py +++ b/py-scripts/example_open_connection.py @@ -51,9 +51,13 @@ class IPv4Test(LFCliBase): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.create(radio="wiphy0", sta_names_=self.sta_list, debug=self.debug) self.station_profile.admin_up() - print(" ",flush=True) - time.sleep(15) - self._pass("Station build finished",print_=True) + if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30): + self._pass("Station build finished", print_=True) + exit(0) + else: + self._fail("Stations not able to acquire IP. Please check network input.", print_=True) + exit(1) + def cleanup(self, sta_list): self.station_profile.cleanup(sta_list) diff --git a/py-scripts/example_wep_connection.py b/py-scripts/example_wep_connection.py index 6b6f3640..3ad8b0c9 100755 --- a/py-scripts/example_wep_connection.py +++ b/py-scripts/example_wep_connection.py @@ -52,9 +52,12 @@ class IPv4Test(LFCliBase): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.station_profile.admin_up() - time.sleep(15) - self._pass("Station build finished", print_=True) - exit(0) + if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30): + self._pass("Station build finished", print_=True) + exit(0) + else: + self._fail("Stations not able to acquire IP. Please check network input.", print_=True) + exit(1) def cleanup(self, sta_list): self.station_profile.cleanup(sta_list) diff --git a/py-scripts/example_wpa2_connection.py b/py-scripts/example_wpa2_connection.py index d7189273..e349095e 100755 --- a/py-scripts/example_wpa2_connection.py +++ b/py-scripts/example_wpa2_connection.py @@ -52,9 +52,12 @@ class IPv4Test(LFCliBase): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.station_profile.admin_up() - self._pass("Station build finished",print_=True) - time.sleep(15) - exit(0) + if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30): + self._pass("Station build finished", print_=True) + exit(0) + else: + self._fail("Stations not able to acquire IP. Please check network input.", print_=True) + exit(1) def cleanup(self, sta_list): self.station_profile.cleanup(sta_list) diff --git a/py-scripts/example_wpa3_connection.py b/py-scripts/example_wpa3_connection.py index 5efe6e7f..329056a1 100755 --- a/py-scripts/example_wpa3_connection.py +++ b/py-scripts/example_wpa3_connection.py @@ -52,9 +52,13 @@ class IPv4Test(LFCliBase): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.station_profile.admin_up() - time.sleep(15) - self._pass("Station build finished",print_=True) - exit(0) + if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30): + self._pass("Station build finished", print_=True) + exit(0) + else: + self._fail("Stations not able to acquire IP. Please check network input.", print_=True) + exit(1) + def cleanup(self, sta_list): self.station_profile.cleanup(sta_list) diff --git a/py-scripts/example_wpa_connection.py b/py-scripts/example_wpa_connection.py index 1d4aa431..9331f70f 100755 --- a/py-scripts/example_wpa_connection.py +++ b/py-scripts/example_wpa_connection.py @@ -52,11 +52,12 @@ class IPv4Test(LFCliBase): self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.station_profile.admin_up() - self._pass("Station build finished",print_=True) - time.sleep(10) - print(" ",flush=True) - time.sleep(10) - exit(0) + if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30): + self._pass("Station build finished", print_=True) + exit(0) + else: + self._fail("Stations not able to acquire IP. Please check network input.", print_=True) + exit(1) def cleanup(self, sta_list): self.station_profile.cleanup(sta_list)