Message ID | 1488332457-23457-3-git-send-email-masashi.honma@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
On 2017/03/01 10:40, Masashi Honma wrote:
> Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
I recognize this test could fail with old wmediumd because
specifying node location instead of SNR is a functionality
only new wmediumd has.
I could not find out the way to keep backward compatibility...
Masashi Honma.
On Wed, Mar 01, 2017 at 10:45:38AM +0900, Masashi Honma wrote: > I recognize this test could fail with old wmediumd because > specifying node location instead of SNR is a functionality > only new wmediumd has. > > I could not find out the way to keep backward compatibility... Can this case not be determined somehow? It is fine to make a test case return SKIP if wmediumd is not new enough, but the test case should not return FAIL due to the setup being too old.
On 2017/03/01 17:20, Jouni Malinen wrote: > Can this case not be determined somehow? It is fine to make a test case > return SKIP if wmediumd is not new enough, but the test case should not > return FAIL due to the setup being too old. It looks there is not any way to determine the wmediumd is old or not, because old wmediumd can boot with unknown config field. It does not output any error message. Masashi Honma.
On 2017/03/01 18:37, Masashi Honma wrote: > On 2017/03/01 17:20, Jouni Malinen wrote: >> Can this case not be determined somehow? It is fine to make a test case >> return SKIP if wmediumd is not new enough, but the test case should not >> return FAIL due to the setup being too old. > > It looks there is not any way to determine the wmediumd is old or not, > because old wmediumd can boot with unknown config field. It does > not output any error message. I will check with existence of -l option. Masashi Honma.
On Wed, Mar 01, 2017 at 06:58:41PM +0900, Masashi Honma wrote: > On 2017/03/01 18:37, Masashi Honma wrote: > >On 2017/03/01 17:20, Jouni Malinen wrote: > >>Can this case not be determined somehow? It is fine to make a test case > >>return SKIP if wmediumd is not new enough, but the test case should not > >>return FAIL due to the setup being too old. > > > >It looks there is not any way to determine the wmediumd is old or not, > >because old wmediumd can boot with unknown config field. It does > >not output any error message. > > I will check with existence of -l option. What if we bump version for this?
On 2017/03/01 22:31, Bob Copeland wrote:
> What if we bump version for this?
Sorry I could not understand this English with my knowledge ...
Could you say with more easy English ?
Masashi Honma.
On Thu, Mar 02, 2017 at 06:03:31AM +0900, Masashi Honma wrote: > On 2017/03/01 22:31, Bob Copeland wrote: > >What if we bump version for this? > > Sorry I could not understand this English with my knowledge ... > Could you say with more easy English ? Let's make wmediumd 0.3 imply the presence of location-based config and log levels, and wmediumd 0.2 (current version) essentially the version prior to my merging those changes. Then we can use output of `wmediumd -V` (present in both) to determine which features are available. I'll maintain backwards compatibility for matching minor version numbers. So I can just commit an update to version number right now so we don't need to look for "-l". Or we could add feature flags from this point on, but that seems like overkill.
On 2017/03/02 09:51, Bob Copeland wrote: > Let's make wmediumd 0.3 imply the presence of location-based config > and log levels, and wmediumd 0.2 (current version) essentially the > version prior to my merging those changes. > > Then we can use output of `wmediumd -V` (present in both) to determine > which features are available. I'll maintain backwards compatibility > for matching minor version numbers. > > So I can just commit an update to version number right now so we don't > need to look for "-l". > > Or we could add feature flags from this point on, but that seems like > overkill. Thanks ! I will check with return value of -V option. Masashi Honma.
diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index 9da54d3..cdc0ca3 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -34,6 +34,30 @@ ifaces : }; """ +CFG3 = """ +ifaces : +{ + ids = ["%s", "%s", "%s", "%s", "%s" ]; +}; + +model : +{ + type = "path_loss"; + positions = ( + ( 0.0, 0.0), + ( 50.0, 0.0), + (100.0, 0.0), + (150.0, 0.0), + (200.0, 0.0) + ); + tx_powers = (15.0, 15.0, 15.0, 15.0, 15.0); + + model_name = "log_distance"; + path_loss_exp = 3.5; + xg = 0.0; +}; +""" + def output_wmediumd_log(p, params, data): log_file = open(os.path.abspath(os.path.join(params['logdir'], 'wmediumd.log')), 'a') @@ -170,3 +194,74 @@ def _test_wmediumd_path_simple(dev, apdev): dev[i].mesh_group_remove() check_mesh_group_removed(dev[i]) dev[i].dump_monitor() + +def test_wmediumd_path_ttl(dev, apdev, params): + """test a mesh path request TTL""" + # 0 --- 1 --- 2 --- 3 --- 4 + # Test the ttl of mesh path request work. + # If the ttl is shorter than path, the mesh path request should be dropped + fd, fn = tempfile.mkstemp() + try: + f = os.fdopen(fd, 'w') + f.write(CFG3 % (dev[0].own_addr(), dev[1].own_addr(), dev[2].own_addr(), dev[3].own_addr(), dev[4].own_addr())) + f.close() + p = start_wmediumd(fn, params) + try: + _test_wmediumd_path_ttl(dev, apdev, True) + _test_wmediumd_path_ttl(dev, apdev, False) + finally: + stop_wmediumd(p, params) + finally: + os.unlink(fn) + +def _test_wmediumd_path_ttl(dev, apdev, ok): + for i in range(0, 5): + check_mesh_support(dev[i]) + add_open_mesh_network(dev[i], freq="2462", basic_rates="60 120 240") + + # Check for mesh joined + for i in range(0, 5): + check_mesh_group_added(dev[i]) + + state = dev[i].get_status_field("wpa_state") + if state != "COMPLETED": + raise Exception("Unexpected wpa_state on dev" + str(i) + ": " + state) + + mode = dev[i].get_status_field("mode") + if mode != "mesh": + raise Exception("Unexpected mode: " + mode) + + # set mesh path request ttl + subprocess.check_call(["iw", "dev", dev[0].ifname, "set", "mesh_param", "mesh_element_ttl=" + ("4" if ok else "3")]) + + # Check for peer connected + for i in range(0, 5): + check_mesh_peer_connected(dev[i]) + for i in range(1, 4): + check_mesh_peer_connected(dev[i]) + + # Test connectivity 0->4 and 0->4 + hwsim_utils.test_connectivity(dev[0], dev[4], success_expected=ok) + + # Check mpath table on 0 + res, data = dev[0].cmd_execute(['iw', dev[0].ifname, 'mpath', 'dump']) + if res != 0: + raise Exception("iw command failed on dev0") + if ok: + if data.find(dev[1].own_addr() + ' ' + dev[1].own_addr()) == -1 or \ + data.find(dev[4].own_addr() + ' ' + dev[1].own_addr()) == -1: + raise Exception("mpath not found on dev0:\n" + data) + else: + if data.find(dev[1].own_addr() + ' ' + dev[1].own_addr()) == -1 or \ + data.find(dev[4].own_addr() + ' 00:00:00:00:00:00') == -1: + raise Exception("mpath not found on dev0:\n" + data) + if data.find(dev[0].own_addr()) > -1 or \ + data.find(dev[2].own_addr()) > -1 or \ + data.find(dev[3].own_addr()) > -1: + raise Exception("invalid mpath found on dev0:\n" + data) + + # remove mesh groups + for i in range(0, 5): + dev[i].mesh_group_remove() + check_mesh_group_removed(dev[i]) + dev[i].dump_monitor()
Signed-off-by: Masashi Honma <masashi.honma@gmail.com> --- tests/hwsim/test_wmediumd.py | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+)