harness: small additions to proc_mgmt test
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Mon, 2 Oct 2017 15:02:04 +0000 (17:02 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Mon, 2 Oct 2017 15:02:04 +0000 (17:02 +0200)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

tools/harness/tests/proc_mgmt_test.py
usr/tests/proc_mgmt_test/main.c

index 0753e70..e3e2283 100644 (file)
@@ -9,6 +9,7 @@
 
 import datetime
 import tests
+import re
 from common import TestCommon
 from results import PassFailResult
 
@@ -23,18 +24,32 @@ class ProcMgmtTest(TestCommon):
 
     def get_modules(self, build, machine):
         modules = super(ProcMgmtTest, self).get_modules(build, machine)
-        n = 1
-        for i in range(n):
-            modules.add_module("proc_mgmt_test", ["core=3", str(i), str(n)])
-            # modules.add_module("proc_mgmt_test", ["core=3", "1"])
+        modules.add_module("proc_mgmt_test", ["core=3", "0", "starter"])
         return modules
 
     def get_finish_string(self):
         return "TEST DONE"
 
     def process_data(self, testdir, rawiter):
+        sleeper = False
+        num_wait = 0        
+
         for line in rawiter:
-            if line.startswith("FAIL:"):
+
+            if line.startswith("Unblocked") and sleeper:
+                num_wait += 1
+                sleeper = False
+            else:
+                sleeper = False
+
+            if line.startswith("Sleeper exit"):
+                sleeper = True
+            
+
+            if line.startswith("Failed"):
                 return PassFailResult(False)
 
-        return PassFailResult(True)
+        if num_wait == 2:
+            return PassFailResult(True)
+        else:
+            return PassFailResult(False)
index 46a6953..07e94d2 100644 (file)
@@ -21,7 +21,6 @@
 
 #define PROC_MGMT_BENCH 1
 #define PROC_MGMT_BENCH_MIN_RUNS 20
-// int total_ids;
 
 static errval_t test_spawn(coreid_t core_id, char *argv[],
                               struct capref *ret_domain_cap)
@@ -61,6 +60,7 @@ static void test_wait(struct capref domain_cap)
         USER_PANIC("Failed waiting for domain");
        }
 }
+*/
 
 static inline cycles_t calculate_time(cycles_t tsc_start, cycles_t tsc_end)
 {
@@ -109,7 +109,6 @@ static void run_benchmark_spawn(coreid_t target_core)
 
     bench_ctl_destroy(ctl);
 }
-*/
 
 int main(int argc, char **argv)
 {   
@@ -232,12 +231,11 @@ int main(int argc, char **argv)
        }
     printf("Unblocked \n");
 
-    /*
     printf("Running benchmarks core 0 \n");
     run_benchmark_spawn(0);
     printf("Running benchmarks core 3 \n");
     run_benchmark_spawn(3);
-    */
+
     printf("TEST DONE\n");
     return 0;
 }