harness: fixed tfpt test
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Fri, 5 May 2017 07:31:20 +0000 (09:31 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Fri, 5 May 2017 07:31:20 +0000 (09:31 +0200)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

tools/harness/tests/tftp.py
usr/tests/tftpclient/main.c

index fbde7e5..025cd43 100644 (file)
@@ -16,7 +16,8 @@ class TftpClientTest(TestCommon):
 
     def setup_tftp_file(self, tftpdir):
         with open(os.path.join(tftpdir, self._filename), 'w') as f:
-            f.write(self._filecontents)
+            for x in range(0, 1000):
+                f.write(self._filecontents)
 
 
     def setup(self, build, machine, testdir):
@@ -34,13 +35,19 @@ class TftpClientTest(TestCommon):
         modules.add_module("netd", ["auto"])
         return modules
 
+    def is_finished(self, line):
+        if 'TFTP TEST DONE.' in line:
+            return True
+        else:
+            return False
+
     def get_finish_string(self):
-        return "TFTP TEST DONE."
+        return 'TFTP TEST DONE.'
 
     def process_data(self, testdir, rawiter):
         passed = False
         for line in rawiter:
-            if self._filecontents in line:
+            if self.get_finish_string() in line:
                 passed = True
 
         return PassFailResult(passed)
index f41c1fc..5884a53 100644 (file)
@@ -77,5 +77,11 @@ int main(int argc, char *argv[])
 
     debug_printf("TFTP READFILE: %zu bytes\n", size);
 
-    debug_printf("TFTP TEST DONE.");
+    debug_printf("TFTP TEST DONE. \n");
+
+    // prevent main exit since we do not have
+    // graceful flounder channel teardown
+    while(1) {
+        event_dispatch(get_default_waitset());
+    }
 }