From 1b1c1ecc8f15bd66b90c91bda93c6aa65d39761d Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Fri, 6 Aug 2021 01:50:09 -0500 Subject: [PATCH] Update tests --- .github/workflows/cron.yml | 247 +++++++++++++++++++++++++++++++++++-- .github/workflows/main.yml | 247 +++++++++++++++++++++++++++++++++++-- 2 files changed, 470 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 44ad71c..01b752b 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -195,17 +195,19 @@ jobs: y ANSWERS + grep -q 'modecfgdns="8.8.8.8 8.8.4.4"' /etc/ipsec.d/ikev2.conf ls -ld /etc/ipsec.d/vpnclient.mobileconfig ls -ld /etc/ipsec.d/vpnclient.sswan ls -ld /etc/ipsec.d/vpnclient.p12 restart_ipsec grep pluto "$log1" | tail -n 20 - ipsec status ipsec status | grep -q ikev2-cp bash ikev2.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" + + sed -i '/^include /d' /etc/ipsec.conf + VPN_CLIENT_NAME=vpnclient1 \ VPN_DNS_NAME=vpn.example.com \ VPN_DNS_SRV1=1.1.1.1 \ @@ -267,16 +294,20 @@ jobs: grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan restart_ipsec - grep pluto "$log1" | tail -n 20 - ipsec status 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 @@ -284,12 +315,93 @@ jobs: ls -ld /etc/ipsec.d/vpnclient2.sswan ls -ld /etc/ipsec.d/vpnclient2.p12 - bash ikev2.sh --listclients + 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 <&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" + + apt-get -yqq remove uuid-runtime + sed -i '/^include /d' /etc/ipsec.conf + VPN_CLIENT_NAME=vpnclient1 \ VPN_DNS_NAME=vpn.example.com \ VPN_DNS_SRV1=1.1.1.1 \ @@ -564,16 +703,20 @@ jobs: grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan restart_ipsec - grep pluto "$log1" | tail -n 20 - ipsec status 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 @@ -581,12 +724,93 @@ jobs: ls -ld /etc/ipsec.d/vpnclient2.sswan ls -ld /etc/ipsec.d/vpnclient2.p12 - bash ikev2.sh --listclients + 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 <&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" + + sed -i '/^include /d' /etc/ipsec.conf + VPN_CLIENT_NAME=vpnclient1 \ VPN_DNS_NAME=vpn.example.com \ VPN_DNS_SRV1=1.1.1.1 \ @@ -296,16 +323,20 @@ jobs: grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan restart_ipsec - grep pluto "$log1" | tail -n 20 - ipsec status 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 @@ -313,12 +344,93 @@ jobs: ls -ld /etc/ipsec.d/vpnclient2.sswan ls -ld /etc/ipsec.d/vpnclient2.p12 - bash ikev2.sh --listclients + 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 <&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" + + apt-get -yqq remove uuid-runtime + sed -i '/^include /d' /etc/ipsec.conf + VPN_CLIENT_NAME=vpnclient1 \ VPN_DNS_NAME=vpn.example.com \ VPN_DNS_SRV1=1.1.1.1 \ @@ -593,16 +732,20 @@ jobs: grep -q 'vpn.example.com' /etc/ipsec.d/vpnclient1.sswan restart_ipsec - grep pluto "$log1" | tail -n 20 - ipsec status 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 @@ -610,12 +753,93 @@ jobs: ls -ld /etc/ipsec.d/vpnclient2.sswan ls -ld /etc/ipsec.d/vpnclient2.p12 - bash ikev2.sh --listclients + 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 <