addd virtual interface for testing
authorLaurent Mazet <mazet@softndesign.org>
Sat, 7 Jun 2025 08:06:14 +0000 (10:06 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sat, 7 Jun 2025 08:10:36 +0000 (10:10 +0200)
ulvpn.c

diff --git a/ulvpn.c b/ulvpn.c
index 9a76865dd05c896d52d4fed28697ba87f0fd5b03..fae12d905ad6d9ff1fe9ebde7127504709382ba5 100644 (file)
--- a/ulvpn.c
+++ b/ulvpn.c
@@ -445,6 +445,8 @@ int main (int argc, char **argv)
     return rc;
 }
 
+/* test: ip addr list | grep 10\.1\.0\. || { ip link add eth0 type dummy && ip addr add dev eth0 10.1.0.1/24; } */
+
 /* test: ulvpn.exe -h | grep usage */
 /* test: ulvpn.exe help 2>&1 | grep usage */
 /* test: ulvpn.exe -d 2>&1 | grep 'dev tun not specified' */
@@ -480,6 +482,8 @@ int main (int argc, char **argv)
 
 /* test: ulvpn.exe -v 5 -t udp://\*:1234 -u udp://localhost:1235 & pid1=$!; sleep 1; nc -ul 1235 > pcap & pid2=$!; sleep 1; echo TEST | nc -Nuq0 10.2.1.1 3000; sleep 1; kill -TERM $pid1 $pid2; strings pcap | grep -q TEST */
 /* test: ulvpn.exe -v 5 -l tun://10.2.1.1 -r tun://10.2.0.0 -t udp://localhost:1234 -u udp://localhost:1235 & pid1=$!; sleep 1; nc -ul 3000 > text & pid2=$!; sleep 1; cat pcap | nc -4Nuq0 -p 1235 localhost 1234; sleep 1; kill -TERM $pid1 $pid2; test "$(cat text)" = TEST */
+
 /* test: rm -f pcap text */
+/* test: ip addr del dev eth0 10.1.0.1/24 && ip link del eth0 type dummy || echo no need to remove eth0 */
 
 /* vim: set ts=4 sw=4 si et: */