Browse Source

tests: Use codecov build hostapd/wpa_supplicant in FST tests

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>
Jouni Malinen 9 years ago
parent
commit
7b7e8a2ee7
1 changed files with 10 additions and 2 deletions
  1. 10 2
      tests/hwsim/test_fst_config.py

+ 10 - 2
tests/hwsim/test_fst_config.py

@@ -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)):