Import Upstream version 1.1~pre11

This commit is contained in:
Guus Sliepen 2019-08-26 13:44:51 +02:00
parent 60cff3039b
commit 1813f3157e
128 changed files with 10991 additions and 3132 deletions

View file

@ -4,6 +4,7 @@ TESTS = \
executables.test \
import-export.test \
invite-join.test \
ns-ping.test \
ping.test \
sptps-basic.test \
variables.test

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.14 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@ -84,9 +84,12 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_check_link_flag.m4 \
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/libgcrypt.m4 \
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
$(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/zlib.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -381,9 +384,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
@ -399,7 +399,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
READLINE_LIBS = @READLINE_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@ -461,6 +460,7 @@ TESTS = \
executables.test \
import-export.test \
invite-join.test \
ns-ping.test \
ping.test \
sptps-basic.test \
variables.test

View file

@ -44,6 +44,7 @@ $tinc $c1 --net foo get name
# Test tinc command line options that should not work
$tinc $c1 -n foo get somethingreallyunknown && exit 1 || true
$tinc $c1 --net && exit 1 || true
$tinc $c1 --net get name && exit 1 || true
$tinc $c1 foo && exit 1 || true

70
test/ns-ping.test Executable file
View file

@ -0,0 +1,70 @@
#!/bin/sh
. ./testlib.sh
# Skip this test if we aren't root or if "ip netns" does not exist
test "`id -u`" = "0" || exit 77
ip netns list || exit 77
# Initialize two nodes
$tinc $c1 <<EOF
init foo
set Mode switch
set Interface ping.test1
set Port 32573
set Address localhost
EOF
cat >$d1/tinc-up <<EOF
#!/bin/sh
ip netns add ping.test1
ip link set dev \$INTERFACE netns ping.test1
ip netns exec ping.test1 ip addr add 192.168.1.1/24 dev \$INTERFACE
ip netns exec ping.test1 ip link set \$INTERFACE up
EOF
$tinc $c2 <<EOF
init bar
set Mode switch
set Interface ping.test2
set Port 32574
EOF
cat >$d2/tinc-up <<EOF
#!/bin/sh
ip netns add ping.test2
ip link set dev \$INTERFACE netns ping.test2
ip netns exec ping.test2 ip addr add 192.168.1.2/24 dev \$INTERFACE
ip netns exec ping.test2 ip link set \$INTERFACE up
EOF
# Exchange configuration files
$tinc $c1 export | $tinc $c2 exchange | $tinc $c1 import
# Start tinc
$tinc $c1 start $r1
$tinc $c2 start $r2
sleep 1
# The nodes should not be able to ping each other if there is no connection
ip netns exec ping.test1 ping -W1 -c3 192.168.1.2 && exit 1
# After connecting they should be
$tinc $c2 add ConnectTo foo
sleep 1
ip netns exec ping.test1 ping -W1 -c3 192.168.1.2
# Clean up
$tinc $c2 stop
$tinc $c1 stop
ip netns del ping.test2
ip netns del ping.test1

View file

@ -6,12 +6,8 @@
mkdir -p $d1
openssl ecparam -genkey -name secp521r1 -noout -out $d1/server.priv
openssl ecparam -genkey -name secp521r1 -noout -out $d1/client.priv
yes '' | openssl req -new -pubkey -key $d1/server.priv -noout -out $d1/server.pub
echo
yes '' | openssl req -new -pubkey -key $d1/client.priv -noout -out $d1/client.pub
echo
$sptps_keypair $d1/server.priv $d1/server.pub
$sptps_keypair $d1/client.priv $d1/client.pub
# Test transfer of a simple file.

View file

@ -5,6 +5,7 @@
tincd=../src/tincd
tinc=../src/tinc
sptps_test=../src/sptps_test
sptps_keypair=../src/sptps_keypair
# Test directories