summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGirish Moturu <gmoturu@google.com>2019-07-29 18:58:12 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-07-29 18:58:12 -0700
commit3cba52b6dc7fdcb44f44a0008c088164f888d0aa (patch)
tree9bafa1de6fd79326eb376d8c0ec15f2d34dc8197
parent34882e98756a9761bb68cc7d15b86d4eb117b827 (diff)
parentdc876da20fedaebd406623a1fa671024211c004f (diff)
downloadconnectivity-3cba52b6dc7fdcb44f44a0008c088164f888d0aa.tar.gz
Merge "[WifiP2pSnifferTest] Fix start_pcap script issue" into qt-dev am: bc3adeb88c
am: dc876da20f Change-Id: Ib7cdbdce89f9bc54ae34b7290cef72ade4328918
-rwxr-xr-xacts/tests/google/wifi/WifiMacRandomizationTest.py28
-rw-r--r--acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py11
2 files changed, 21 insertions, 18 deletions
diff --git a/acts/tests/google/wifi/WifiMacRandomizationTest.py b/acts/tests/google/wifi/WifiMacRandomizationTest.py
index 09630d771..fa01d45b6 100755
--- a/acts/tests/google/wifi/WifiMacRandomizationTest.py
+++ b/acts/tests/google/wifi/WifiMacRandomizationTest.py
@@ -272,14 +272,15 @@ class WifiMacRandomizationTest(WifiBaseTest):
@test_tracker_info(uuid="2dd0a05e-a318-45a6-81cd-962e098fa242")
def test_set_mac_randomization_to_none(self):
self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.log_path, self.test_name)
+ self.packet_capture, 'dual', self.test_name)
network = self.wpapsk_2g
# Set macRandomizationSetting to RANDOMIZATION_NONE.
network["macRand"] = RANDOMIZATION_NONE
self.connect_to_network_and_verify_mac_randomization(network,
status=RANDOMIZATION_NONE)
- pcap_fname = os.path.join(self.log_path, self.test_name,
- (self.test_name + '_2G.pcap'))
+ pcap_fname = '%s_%s.pcap' % \
+ (self.pcap_procs[hostapd_constants.BAND_2G][1],
+ hostapd_constants.BAND_2G.upper())
time.sleep(SHORT_TIMEOUT)
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
packets = rdpcap(pcap_fname)
@@ -461,14 +462,15 @@ class WifiMacRandomizationTest(WifiBaseTest):
if not result:
raise ValueError("Failed to configure channel for 2G band")
self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.log_path, self.test_name)
+ self.packet_capture, 'dual', self.test_name)
# re-connect to the softAp network after sniffer is started
wutils.connect_to_wifi_network(self.dut_client, self.wpapsk_2g)
wutils.connect_to_wifi_network(self.dut_client, softap)
time.sleep(SHORT_TIMEOUT)
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
- pcap_fname = os.path.join(self.log_path, self.test_name,
- (self.test_name + '_2G.pcap'))
+ pcap_fname = '%s_%s.pcap' % \
+ (self.pcap_procs[hostapd_constants.BAND_2G][1],
+ hostapd_constants.BAND_2G.upper())
packets = rdpcap(pcap_fname)
self.verify_mac_not_found_in_pcap(self.soft_ap_factory_mac, packets)
self.verify_mac_not_found_in_pcap(self.sta_factory_mac, packets)
@@ -520,13 +522,14 @@ class WifiMacRandomizationTest(WifiBaseTest):
"""
self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.log_path, self.test_name)
+ self.packet_capture, 'dual', self.test_name)
time.sleep(SHORT_TIMEOUT)
network = self.wpapsk_5g
rand_mac = self.connect_to_network_and_verify_mac_randomization(network)
wutils.send_link_probes(self.dut, 3, 3)
- pcap_fname = os.path.join(self.log_path, self.test_name,
- (self.test_name + '_5G.pcap'))
+ pcap_fname = '%s_%s.pcap' % \
+ (self.pcap_procs[hostapd_constants.BAND_5G][1],
+ hostapd_constants.BAND_5G.upper())
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
time.sleep(SHORT_TIMEOUT)
packets = rdpcap(pcap_fname)
@@ -546,11 +549,12 @@ class WifiMacRandomizationTest(WifiBaseTest):
"""
self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.log_path, self.test_name)
+ self.packet_capture, 'dual', self.test_name)
wutils.start_wifi_connection_scan(self.dut)
time.sleep(SHORT_TIMEOUT)
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
- pcap_fname = os.path.join(self.log_path, self.test_name,
- (self.test_name + '_2G.pcap'))
+ pcap_fname = '%s_%s.pcap' % \
+ (self.pcap_procs[hostapd_constants.BAND_2G][1],
+ hostapd_constants.BAND_2G.upper())
packets = rdpcap(pcap_fname)
self.verify_mac_not_found_in_pcap(self.sta_factory_mac, packets)
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py b/acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
index a359debd7..f9d2b2312 100644
--- a/acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
+++ b/acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
@@ -25,7 +25,7 @@ from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi.p2p.WifiP2pBaseTest import WifiP2pBaseTest
from acts.test_utils.wifi.p2p import wifi_p2p_test_utils as wp2putils
from acts.test_utils.wifi.p2p import wifi_p2p_const as p2pconsts
-from acts.controllers.ap_lib import hostapd_constants
+from acts.controllers.ap_lib.hostapd_constants import BAND_2G
from scapy.all import *
WPS_PBC = wp2putils.WifiP2PEnums.WpsInfo.WIFI_WPS_INFO_PBC
@@ -53,7 +53,7 @@ class WifiP2pSnifferTest(WifiP2pBaseTest):
def setup_test(self):
super(WifiP2pSnifferTest, self).setup_test()
self.pcap_procs = wutils.start_pcap(
- self.packet_capture, '2g', self.log_path, self.test_name)
+ self.packet_capture, '2g', self.test_name)
def teardown_test(self):
self.verify_mac_no_leakage()
@@ -62,8 +62,7 @@ class WifiP2pSnifferTest(WifiP2pBaseTest):
def configure_packet_capture(self):
"""Configure packet capture on the social channels."""
self.packet_capture = self.packet_capture[0]
- result = self.packet_capture.configure_monitor_mode(
- hostapd_constants.BAND_2G, 6)
+ result = self.packet_capture.configure_monitor_mode(BAND_2G, 6)
if not result:
raise ValueError("Failed to configure channel for 2G band")
@@ -72,8 +71,8 @@ class WifiP2pSnifferTest(WifiP2pBaseTest):
self.log.info("Stopping packet capture")
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
# Verify factory MAC is not leaked in 2G pcaps
- pcap_fname = os.path.join(self.log_path, self.test_name,
- (self.test_name + '_2G.pcap'))
+ pcap_fname = '%s_%s.pcap' % (self.pcap_procs[BAND_2G][1],
+ BAND_2G.upper())
packets = rdpcap(pcap_fname)
wutils.verify_mac_not_found_in_pcap(self.dut1_mac, packets)
wutils.verify_mac_not_found_in_pcap(self.dut2_mac, packets)