]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use codecov build hostapd/wpa_supplicant in FST tests
authorJouni Malinen <j@w1.fi>
Sun, 19 Jul 2015 20:10:55 +0000 (23:10 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Jul 2015 20:10:55 +0000 (23:10 +0300)
Try to use the special build for --codecov purposes, if present, instead
of hardcoding the hostapd/wpa_supplicant binary to the default location.
This is needed to collect code coverage correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_fst_config.py

index 65980657a681f3012e91cf0a57a9426431e36699..938cf9ac028e6a7777a49677b47c8c3556aa161b 100644 (file)
@@ -158,7 +158,11 @@ class FstLauncher:
             raise Exception("No FST APs to start")
         pidfile = self.fst_logpath + '/' + 'myhostapd.pid'
         mylogfile = self.fst_logpath + '/' + 'fst-hostapd'
-        cmd = [ '../../hostapd/hostapd', '-B', '-ddd',
+        prg = os.path.join(self.fst_logpath,
+                           'alt-hostapd/hostapd/hostapd')
+        if not os.path.exists(prg):
+            prg = '../../hostapd/hostapd'
+        cmd = [ prg, '-B', '-ddd',
                 '-P', pidfile, '-f', mylogfile, '-g', self.hapd_fst_global]
         for i in range(0, len(self.cfgs_to_run)):
             cfg = self.cfgs_to_run[i]
@@ -181,7 +185,11 @@ class FstLauncher:
             raise Exception("No FST STAs to start")
         pidfile = self.fst_logpath + '/' + 'mywpa_supplicant.pid'
         mylogfile = self.fst_logpath + '/' + 'fst-wpa_supplicant'
-        cmd = [ '../../wpa_supplicant/wpa_supplicant', '-B', '-ddd',
+        prg = os.path.join(self.fst_logpath,
+                           'alt-wpa_supplicant/wpa_supplicant/wpa_supplicant')
+        if not os.path.exists(prg):
+            prg = '../../wpa_supplicant/wpa_supplicant'
+        cmd = [ prg, '-B', '-ddd',
                 '-P' + pidfile, '-f', mylogfile, '-g', self.wsup_fst_global ]
         sta_no = 0
         for i in range(0, len(self.cfgs_to_run)):