From 7035c61f2347b8a5ae6dc32025af0a4631d8bb1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roni=20H=C3=A4cki?= Date: Fri, 5 May 2017 09:31:20 +0200 Subject: [PATCH] harness: fixed tfpt test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roni Häcki --- tools/harness/tests/tftp.py | 13 ++++++++++--- usr/tests/tftpclient/main.c | 8 +++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/harness/tests/tftp.py b/tools/harness/tests/tftp.py index fbde7e5..025cd43 100644 --- a/tools/harness/tests/tftp.py +++ b/tools/harness/tests/tftp.py @@ -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) diff --git a/usr/tests/tftpclient/main.c b/usr/tests/tftpclient/main.c index f41c1fc..5884a53 100644 --- a/usr/tests/tftpclient/main.c +++ b/usr/tests/tftpclient/main.c @@ -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()); + } } -- 1.7.2.5