def test_ping6_ib_solicited_active(self): """Validate that ping6 works correctly on an NDP created using Aware discovery with SOLICITED/ACTIVE sessions.""" p_dut = self.android_devices[0] s_dut = self.android_devices[1] # create NDP (p_req_key, s_req_key, p_aware_if, s_aware_if, p_ipv6, s_ipv6) = autils.create_ib_ndp( p_dut, s_dut, p_config=autils.create_discovery_config( self.SERVICE_NAME, aconsts.PUBLISH_TYPE_SOLICITED), s_config=autils.create_discovery_config( self.SERVICE_NAME, aconsts.SUBSCRIBE_TYPE_ACTIVE), device_startup_offset=self.device_startup_offset) self.log.info("Interface names: P=%s, S=%s", p_aware_if, s_aware_if) self.log.info("Interface addresses (IPv6): P=%s, S=%s", p_ipv6, s_ipv6) # run ping6 self.run_ping6(p_dut, s_ipv6, p_aware_if) self.run_ping6(s_dut, p_ipv6, s_aware_if) # clean-up p_dut.droid.connectivityUnregisterNetworkCallback(p_req_key) s_dut.droid.connectivityUnregisterNetworkCallback(s_req_key)
def run_iperf_single_ndp_aware_only(self, use_ib, results): """Measure iperf performance on a single NDP, with Aware enabled and no infrastructure connection - i.e. device is not associated to an AP. Args: use_ib: True to use in-band discovery, False to use out-of-band discovery. results: Dictionary into which to place test results. """ init_dut = self.android_devices[0] resp_dut = self.android_devices[1] if use_ib: # note: Publisher = Responder, Subscribe = Initiator (resp_req_key, init_req_key, resp_aware_if, init_aware_if, resp_ipv6, init_ipv6) = autils.create_ib_ndp( resp_dut, init_dut, autils.create_discovery_config( self.SERVICE_NAME, aconsts.PUBLISH_TYPE_UNSOLICITED), autils.create_discovery_config( self.SERVICE_NAME, aconsts.SUBSCRIBE_TYPE_PASSIVE), self.device_startup_offset) else: (init_req_key, resp_req_key, init_aware_if, resp_aware_if, init_ipv6, resp_ipv6) = autils.create_oob_ndp(init_dut, resp_dut) self.log.info("Interface names: I=%s, R=%s", init_aware_if, resp_aware_if) self.log.info("Interface addresses (IPv6): I=%s, R=%s", init_ipv6, resp_ipv6) # Run iperf3 result, data = init_dut.run_iperf_server("-D") asserts.assert_true(result, "Can't start iperf3 server") result, data = resp_dut.run_iperf_client( "%s%%%s" % (init_ipv6, resp_aware_if), "-6 -J") self.log.debug(data) asserts.assert_true(result, "Failure starting/running iperf3 in client mode") self.log.debug(pprint.pformat(data)) # clean-up resp_dut.droid.connectivityUnregisterNetworkCallback(resp_req_key) init_dut.droid.connectivityUnregisterNetworkCallback(init_req_key) # Collect results data_json = json.loads("".join(data)) if "error" in data_json: asserts.fail("iperf run failed: %s" % data_json["error"], extras=data_json) results["tx_rate"] = data_json["end"]["sum_sent"]["bits_per_second"] results["rx_rate"] = data_json["end"]["sum_received"][ "bits_per_second"] self.log.info("iPerf3: Sent = %d bps Received = %d bps", results["tx_rate"], results["rx_rate"])