summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-05-11 16:24:45 -0500
committerKinsey Moore <kinsey.moore@oarcorp.com>2023-05-15 21:46:30 -0500
commite22f951630ff77a49f15a71e350bd4198273b9c1 (patch)
tree805fd1e1e7890dcf646a2beda16781235e648eab
parenttestsuites/ntp: Remove limits and duplicates (diff)
downloadrtems-net-services-e22f951630ff77a49f15a71e350bd4198273b9c1.tar.bz2
netservices.py: Move defaults out of tests
network-config.h unconditionally defines all configuration items, so applications can not rely on their absence to use defaults. This moves defaults out of the application/test because they cannot be used there.
-rw-r--r--config.inc2
-rw-r--r--testsuites/ntp01/test_main.c10
2 files changed, 3 insertions, 9 deletions
diff --git a/config.inc b/config.inc
index f4411f4..da4d0d6 100644
--- a/config.inc
+++ b/config.inc
@@ -1,3 +1,5 @@
NET_CFG_IFACE = lo0
NET_CFG_IFACE_OPTS =
NET_CFG_BOOT_PROT = dhcp
+NET_CFG_NTP_IP = 0.freebsd.pool.ntp.org
+NET_CFG_DNS_IP = 8.8.8.8
diff --git a/testsuites/ntp01/test_main.c b/testsuites/ntp01/test_main.c
index bc9db50..cb28554 100644
--- a/testsuites/ntp01/test_main.c
+++ b/testsuites/ntp01/test_main.c
@@ -73,19 +73,11 @@ rtems_telnetd_config_table rtems_telnetd_config = {
#define NTP_DEBUG_STR ntp_xstr(NTP_DEBUG)
static const char etc_resolv_conf[] =
-#ifdef NET_CFG_NTP_IP
"nameserver " NET_CFG_DNS_IP "\n";
-#else
- "nameserver 8.8.8.8\n";
-#endif
static const char etc_ntp_conf[] =
"tos minclock 3 maxclock 6\n"
-#ifdef NET_CFG_NTP_IP
- "server " NET_CFG_NTP_IP "\n"
-#else
- "pool 0.freebsd.pool.ntp.org iburst\n"
-#endif
+ "pool " NET_CFG_NTP_IP " iburst\n"
"restrict default limited kod nomodify notrap noquery nopeer\n"
"restrict source limited kod nomodify notrap noquery\n"
"restrict 10.0.0.0 mask 255.0.0.0\n"