[rtems-libbsd commit] libbsd: Add TFTP filesystem to test media01

Christian Mauderer christianm at rtems.org
Tue Apr 26 06:15:57 UTC 2022


Module:    rtems-libbsd
Branch:    6-freebsd-12
Commit:    d63f9cd9d97510da9ac85ce7fc658093bc454d02
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=d63f9cd9d97510da9ac85ce7fc658093bc454d02

Author:    Frank Kühndel <frank.kuehndel at embedded-brains.de>
Date:      Fri Apr  8 16:05:23 2022 +0200

libbsd: Add TFTP filesystem to test media01

How test media01 can be executed is described in section
*Qemu and Networking* of the README.md at the top of the
rtems-libbsd GIT repository.

When connected via `telnet` with the RTEMS shell of the
media01.exe test executed by QEMU, one can list the filesystems
available for mounting:

TLNT [/] # mount -L
File systems: / dosfs tftpfs

The list will contain `tftpfs`.  The filesystem can be mounted
as in the following example:

TLNT [/] # mkdir /tftp
TLNT [/] # mount -t tftpfs -o verbose "" /tftp

A TFTP server is needed to use this filesystem.  The simplest way
would be to run such a server on the host machine and open the
firewall for the TFTP protocol (port 69) on the TAP device used.
Files can then be downloaded using the usual shell commands
as in the following example:

TLNT [/] # cat /tftp/169.254.1.1:hello.txt

Uploading is also possible provided the TFTP server supports it,
for example:

TLNT [/] # cp /etc/dhcpcd.duid /tftp/169.254.1.1:myfile

---

 libbsd.py                     | 2 +-
 testsuite/media01/test_main.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libbsd.py b/libbsd.py
index 1469b8df..2d3b718d 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -5546,7 +5546,7 @@ class tests(builder.Module):
         self.addTest(mm.generator['test']('smp01', ['test_main'], extraLibs = ['rtemstest']))
         self.addTest(mm.generator['test']('media01', ['test_main', 'pattern-test'],
                                           runTest = False,
-                                          extraLibs = ['ftpd', 'telnetd']))
+                                          extraLibs = ['tftpfs', 'ftpd', 'telnetd']))
         self.addTest(mm.generator['test']('mcast01', ['test_main']))
         self.addTest(mm.generator['test']('vlan01', ['test_main'], netTest = True))
         self.addTest(mm.generator['test']('lagg01', ['test_main'], netTest = True))
diff --git a/testsuite/media01/test_main.c b/testsuite/media01/test_main.c
index 2a1c9aae..001c80a8 100644
--- a/testsuite/media01/test_main.c
+++ b/testsuite/media01/test_main.c
@@ -201,6 +201,8 @@ early_initialization(void)
 
 #define CONFIGURE_FILESYSTEM_DOSFS
 
+#define CONFIGURE_FILESYSTEM_TFTPFS
+
 #define CONFIGURE_MAXIMUM_PROCESSORS 32
 
 #define CONFIGURE_RECORD_PER_PROCESSOR_ITEMS 4096



More information about the vc mailing list