5 from common import TestCommon
6 from barrelfish import BootModules
7 from results import PassFailResult
10 class TftpClientTest(TestCommon):
11 '''Barrelfish TFTP client test'''
14 _filename = "hello.txt"
15 _filecontents = "Hello world via TFTP!"
17 def setup_tftp_file(self, tftpdir):
18 with open(os.path.join(tftpdir, self._filename), 'w') as f:
19 f.write(self._filecontents)
22 def setup(self, build, machine, testdir):
23 super(TftpClientTest, self).setup(build, machine, testdir)
24 self.setup_tftp_file(machine.get_tftp_dir())
26 def get_modules(self, build, machine):
27 modules = super(TftpClientTest, self).get_modules(build, machine)
28 tftpdir = machine._operations.get_tftp_subdir()
29 modules.add_module("tests/tftpclient",
30 ['--server=tftp://10.110.4.4:69',
31 '--file=/%s/hello.txt' % tftpdir ])
32 modules.add_module("e1000n", ["auto"])
33 modules.add_module("NGD_mng", ["auto"])
34 modules.add_module("netd", ["auto"])
37 def get_finish_string(self):
38 return "TFTP TEST DONE."
40 def process_data(self, testdir, rawiter):
43 if self._filecontents in line:
46 return PassFailResult(passed)