From 86aaaf1283608315a7662e2005e2989b4775ee0d Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Tue, 14 Sep 2021 09:44:06 -0500 Subject: [PATCH] Update tests --- .github/workflows/cron.yml | 550 ++++++++++++++++++++++++++++++++++++- .github/workflows/main.yml | 550 ++++++++++++++++++++++++++++++++++++- 2 files changed, 1074 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 829bd5f..f7d29d5 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -39,23 +39,27 @@ jobs: $wget_c vpnsetup_centos.sh https://git.io/vpnsetup-centos $wget_c vpnsetup_amzn.sh https://git.io/vpnsetup-amzn $wget_c vpnsetup_ubuntu.sh https://git.io/vpnsetup-ubuntu + $wget_c vpnsetup_alpine.sh https://git.io/vpnsetup-alpine $wget_c quickstart.sh https://git.io/vpnquickstart $wget_c ikev2setup.sh https://git.io/ikev2setup $wget_c vpnupgrade.sh https://git.io/vpnupgrade $wget_c vpnupgrade_centos.sh https://git.io/vpnupgrade-centos $wget_c vpnupgrade_amzn.sh https://git.io/vpnupgrade-amzn $wget_c vpnupgrade_ubuntu.sh https://git.io/vpnupgrade-ubuntu + $wget_c vpnupgrade_alpine.sh https://git.io/vpnupgrade-alpine $wget_c vpnsetup2.sh "$gh_url/vpnsetup.sh" $wget_c vpnsetup_centos2.sh "$gh_url/vpnsetup_centos.sh" $wget_c vpnsetup_amzn2.sh "$gh_url/vpnsetup_amzn.sh" $wget_c vpnsetup_ubuntu2.sh "$gh_url/vpnsetup_ubuntu.sh" + $wget_c vpnsetup_alpine2.sh "$gh_url/vpnsetup_alpine.sh" $wget_c quickstart2.sh "$gh_url/extras/quickstart.sh" $wget_c ikev2setup2.sh "$gh_url/extras/ikev2setup.sh" $wget_c vpnupgrade2.sh "$gh_url/extras/vpnupgrade.sh" $wget_c vpnupgrade_centos2.sh "$gh_url/extras/vpnupgrade_centos.sh" $wget_c vpnupgrade_amzn2.sh "$gh_url/extras/vpnupgrade_amzn.sh" $wget_c vpnupgrade_ubuntu2.sh "$gh_url/extras/vpnupgrade_ubuntu.sh" + $wget_c vpnupgrade_alpine2.sh "$gh_url/extras/vpnupgrade_alpine.sh" curl -fsSI https://bit.ly/addvpnuser | grep -q 'add_vpn_user.sh' curl -fsSI https://bit.ly/delvpnuser | grep -q 'del_vpn_user.sh' @@ -65,23 +69,27 @@ jobs: diff vpnsetup_centos.sh ../vpnsetup_centos.sh diff vpnsetup_amzn.sh ../vpnsetup_amzn.sh diff vpnsetup_ubuntu.sh ../vpnsetup_ubuntu.sh + diff vpnsetup_alpine.sh ../vpnsetup_alpine.sh diff quickstart.sh ../extras/quickstart.sh diff ikev2setup.sh ../extras/ikev2setup.sh diff vpnupgrade.sh ../extras/vpnupgrade.sh diff vpnupgrade_centos.sh ../extras/vpnupgrade_centos.sh diff vpnupgrade_amzn.sh ../extras/vpnupgrade_amzn.sh diff vpnupgrade_ubuntu.sh ../extras/vpnupgrade_ubuntu.sh + diff vpnupgrade_alpine.sh ../extras/vpnupgrade_alpine.sh diff vpnsetup2.sh ../vpnsetup.sh diff vpnsetup_centos2.sh ../vpnsetup_centos.sh diff vpnsetup_amzn2.sh ../vpnsetup_amzn.sh diff vpnsetup_ubuntu2.sh ../vpnsetup_ubuntu.sh + diff vpnsetup_alpine2.sh ../vpnsetup_alpine.sh diff quickstart2.sh ../extras/quickstart.sh diff ikev2setup2.sh ../extras/ikev2setup.sh diff vpnupgrade2.sh ../extras/vpnupgrade.sh diff vpnupgrade_centos2.sh ../extras/vpnupgrade_centos.sh diff vpnupgrade_amzn2.sh ../extras/vpnupgrade_amzn.sh diff vpnupgrade_ubuntu2.sh ../extras/vpnupgrade_ubuntu.sh + diff vpnupgrade_alpine2.sh ../extras/vpnupgrade_alpine.sh test_set_1: needs: check_urls @@ -147,12 +155,8 @@ jobs: yum -y -q install wget rsyslog systemctl start rsyslog - if [ "$1" != "amazon" ]; then - wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-centos - else - wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-amzn - fi - sed -i '/swan_ver_latest=/s/^/#/' vpnsetup.sh + wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup + sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' vpnsetup.sh sh vpnsetup.sh @@ -178,6 +182,59 @@ jobs: ls -l /usr/bin/ikev2.sh ls -l /opt/src/ikev2.sh + wget -t 3 -T 30 -nv -O vpnunst.sh https://git.io/vpnuninstall + bash vpnunst.sh < run.sh + + apk add -U wget rsyslog + rsyslogd + + wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup + sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' vpnsetup.sh + + sh vpnsetup.sh + + ipsec initnss + xl2tpd -c /etc/xl2tpd/xl2tpd.conf + restart_ipsec + + netstat -anpu | grep pluto + netstat -anpu | grep xl2tpd + iptables -nvL + iptables -nvL | grep -q 'ppp+' + iptables -nvL | grep -q '192\.168\.43\.0/24' + iptables -nvL -t nat + iptables -nvL -t nat | grep -q '192\.168\.42\.0/24' + iptables -nvL -t nat | grep -q '192\.168\.43\.0/24' + grep pluto "$log1" + grep xl2tpd "$log2" + ipsec status + ipsec status | grep -q l2tp-psk + ipsec status | grep -q xauth-psk + + ls -l /usr/bin/ikev2.sh + ls -l /opt/src/ikev2.sh + + wget -t 3 -T 30 -nv -O vpnunst.sh https://git.io/vpnuninstall + bash vpnunst.sh <&1 | grep -i "abort" + 4 + vpnclient2 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "abort" + 2 + vpnclient2 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "abort" + 5 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "invalid" + + apk del uuidgen + sed -i '/^include /d' /etc/ipsec.conf + + VPN_CLIENT_NAME=vpnclient1 \ + VPN_DNS_NAME=vpn.example.com \ + VPN_DNS_SRV1=1.1.1.1 \ + VPN_DNS_SRV2=1.0.0.1 \ + bash ikev2.sh --auto + + grep -q 'leftid=@vpn.example.com' /etc/ipsec.d/ikev2.conf + grep -q 'modecfgdns="1.1.1.1 1.0.0.1"' /etc/ipsec.d/ikev2.conf + ls -ld /etc/ipsec.d/vpnclient1.mobileconfig + ls -ld /etc/ipsec.d/vpnclient1.sswan + ls -ld /etc/ipsec.d/vpnclient1.p12 + grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.mobileconfig + grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan + + restart_ipsec + ipsec status | grep -q ikev2-cp + + bash ikev2.sh --auto --addclient invalidclient: 2>&1 | grep -i "warning" + bash ikev2.sh --addclient invalidclient: 2>&1 | grep -i "invalid" + bash ikev2.sh --addclient vpnclient1 2>&1 | grep -i "already exists" + + bash ikev2.sh --addclient vpnclient2 + + ls -ld /etc/ipsec.d/vpnclient2.mobileconfig + ls -ld /etc/ipsec.d/vpnclient2.sswan + ls -ld /etc/ipsec.d/vpnclient2.p12 + + bash ikev2.sh --exportclient nonexistclient 2>&1 | grep -i "does not exist" + + rm -f /etc/ipsec.d/vpnclient2* + bash ikev2.sh --exportclient vpnclient2 + + ls -ld /etc/ipsec.d/vpnclient2.mobileconfig + ls -ld /etc/ipsec.d/vpnclient2.sswan + ls -ld /etc/ipsec.d/vpnclient2.p12 + + bash ikev2.sh --addclient vpnclient2 --exportclient vpnclient2 2>&1 | grep -i "invalid" + + bash ikev2.sh --listclients | grep "vpnclient1" + bash ikev2.sh --listclients | grep "vpnclient2" + + bash ikev2.sh --revokeclient nonexistclient 2>&1 | grep -i "does not exist" + bash ikev2.sh --revokeclient vpnclient2 <&1 | grep -i "already been revoked" + bash ikev2.sh --exportclient vpnclient2 2>&1 | grep -i "revoked" + bash ikev2.sh -h 2>&1 | grep -i "usage:" + bash ikev2.sh --invalidoption 2>&1 | grep -i "usage:" + + bash ikev2.sh --removeikev2 --exportclient vpnclient1 2>&1 | grep -i "invalid" + bash ikev2.sh --removeikev2 < run.sh + + apk add -U wget rsyslog + rsyslogd + + wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup + sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' vpnsetup.sh + + sh vpnsetup.sh + + ipsec initnss + xl2tpd -c /etc/xl2tpd/xl2tpd.conf + restart_ipsec + + netstat -anpu | grep pluto + netstat -anpu | grep xl2tpd + iptables -nvL + iptables -nvL | grep -q 'ppp+' + iptables -nvL | grep -q '192\.168\.43\.0/24' + iptables -nvL -t nat + iptables -nvL -t nat | grep -q '192\.168\.42\.0/24' + iptables -nvL -t nat | grep -q '192\.168\.43\.0/24' + grep pluto "$log1" + grep xl2tpd "$log2" + ipsec status + ipsec status | grep -q l2tp-psk + ipsec status | grep -q xauth-psk + + ls -l /usr/bin/ikev2.sh + ls -l /opt/src/ikev2.sh + + wget -t 3 -T 30 -nv -O vpnunst.sh https://git.io/vpnuninstall + bash vpnunst.sh <&1 | grep -i "abort" + 4 + vpnclient2 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "abort" + 2 + vpnclient2 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "abort" + 5 + + ANSWERS + + bash ikev2.sh <&1 | grep -i "invalid" + + apk del uuidgen + sed -i '/^include /d' /etc/ipsec.conf + + VPN_CLIENT_NAME=vpnclient1 \ + VPN_DNS_NAME=vpn.example.com \ + VPN_DNS_SRV1=1.1.1.1 \ + VPN_DNS_SRV2=1.0.0.1 \ + bash ikev2.sh --auto + + grep -q 'leftid=@vpn.example.com' /etc/ipsec.d/ikev2.conf + grep -q 'modecfgdns="1.1.1.1 1.0.0.1"' /etc/ipsec.d/ikev2.conf + ls -ld /etc/ipsec.d/vpnclient1.mobileconfig + ls -ld /etc/ipsec.d/vpnclient1.sswan + ls -ld /etc/ipsec.d/vpnclient1.p12 + grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.mobileconfig + grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan + + restart_ipsec + ipsec status | grep -q ikev2-cp + + bash ikev2.sh --auto --addclient invalidclient: 2>&1 | grep -i "warning" + bash ikev2.sh --addclient invalidclient: 2>&1 | grep -i "invalid" + bash ikev2.sh --addclient vpnclient1 2>&1 | grep -i "already exists" + + bash ikev2.sh --addclient vpnclient2 + + ls -ld /etc/ipsec.d/vpnclient2.mobileconfig + ls -ld /etc/ipsec.d/vpnclient2.sswan + ls -ld /etc/ipsec.d/vpnclient2.p12 + + bash ikev2.sh --exportclient nonexistclient 2>&1 | grep -i "does not exist" + + rm -f /etc/ipsec.d/vpnclient2* + bash ikev2.sh --exportclient vpnclient2 + + ls -ld /etc/ipsec.d/vpnclient2.mobileconfig + ls -ld /etc/ipsec.d/vpnclient2.sswan + ls -ld /etc/ipsec.d/vpnclient2.p12 + + bash ikev2.sh --addclient vpnclient2 --exportclient vpnclient2 2>&1 | grep -i "invalid" + + bash ikev2.sh --listclients | grep "vpnclient1" + bash ikev2.sh --listclients | grep "vpnclient2" + + bash ikev2.sh --revokeclient nonexistclient 2>&1 | grep -i "does not exist" + bash ikev2.sh --revokeclient vpnclient2 <&1 | grep -i "already been revoked" + bash ikev2.sh --exportclient vpnclient2 2>&1 | grep -i "revoked" + bash ikev2.sh -h 2>&1 | grep -i "usage:" + bash ikev2.sh --invalidoption 2>&1 | grep -i "usage:" + + bash ikev2.sh --removeikev2 --exportclient vpnclient1 2>&1 | grep -i "invalid" + bash ikev2.sh --removeikev2 <