1
0
mirror of synced 2025-02-08 00:09:24 +03:00

Update tests

This commit is contained in:
hwdsl2 2022-02-10 23:10:39 -06:00
parent 80af7a35f3
commit 7e809c2042
3 changed files with 35 additions and 19 deletions

View File

@ -39,7 +39,8 @@ jobs:
$wg vpnsetup_amzn.sh "$gi/vpnsetup-amzn"
$wg vpnsetup_ubuntu.sh "$gi/vpnsetup-ubuntu"
$wg vpnsetup_alpine.sh "$gi/vpnsetup-alpine"
$wg quickstart.sh "$gi/vpnquickstart"
$wg quickstart.sh "$gi/vpnstart"
$wg quickstart_.sh "$gi/vpnquickstart"
$wg ikev2setup.sh "$gi/ikev2setup"
$wg vpnupgrade.sh "$gi/vpnupgrade"
$wg vpnupgrade_centos.sh "$gi/vpnupgrade-centos"
@ -68,6 +69,7 @@ jobs:
diff vpnsetup_ubuntu.sh ../vpnsetup_ubuntu.sh
diff vpnsetup_alpine.sh ../vpnsetup_alpine.sh
diff quickstart.sh ../extras/quickstart.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

View File

@ -22,11 +22,19 @@ jobs:
env:
OS_VERSION: ${{ matrix.os_version }}
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # 2.4.0
with:
persist-credentials: false
- name: Build
run: |
mkdir -p "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
cd "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
mkdir -p scripts/extras
ls -ld "$GITHUB_WORKSPACE/vpnsetup.sh"
cp -f "$GITHUB_WORKSPACE"/*.sh scripts/
cp -f "$GITHUB_WORKSPACE"/extras/*.sh scripts/extras/
cat > run.sh <<'EOF'
#!/bin/bash
set -eEx
@ -71,11 +79,12 @@ jobs:
echo
}
cd /opt/src
yum -y -q update
yum -y -q install wget rsyslog
systemctl start rsyslog
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
cp -f /opt/src/scripts/vpnsetup.sh .
sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' vpnsetup.sh
sh vpnsetup.sh
@ -102,7 +111,7 @@ 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
cp -f /opt/src/scripts/extras/vpnuninstall.sh ./vpnunst.sh
bash vpnunst.sh <<ANSWERS
y
ANSWERS
@ -111,7 +120,7 @@ jobs:
mkdir /etc/xl2tpd
fi
wget -t 3 -T 30 -nv -O quickstart.sh https://git.io/vpnquickstart
cp -f /opt/src/scripts/extras/quickstart.sh .
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
-e '/sleep 1/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh' quickstart.sh
@ -151,9 +160,9 @@ jobs:
fi
if [ "$1" != "amazon" ]; then
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-centos
cp -f /opt/src/scripts/vpnsetup_centos.sh ./vpnsetup.sh
else
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-amzn
cp -f /opt/src/scripts/vpnsetup_amzn.sh ./vpnsetup.sh
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnsetup.sh
@ -190,7 +199,7 @@ jobs:
ls -l /usr/bin/ikev2.sh
ls -l /opt/src/ikev2.sh
wget -t 3 -T 30 -nv -O ikev2.sh https://git.io/ikev2setup # hwdsl2
cp -f /opt/src/scripts/extras/ikev2setup.sh ./ikev2.sh # hwdsl2
sed -i '/swan_ver_latest=/s/^/#/' ikev2.sh
bash ikev2.sh <<ANSWERS
@ -411,7 +420,7 @@ jobs:
restart_ipsec
ipsec status | grep -q ikev2-cp
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade
cp -f /opt/src/scripts/extras/vpnupgrade.sh ./vpnup.sh
sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpnup.sh"' vpnup.sh
for ver in 4.4 ""; do
@ -427,9 +436,9 @@ jobs:
done
if [ "$1" != "amazon" ]; then
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos
cp -f /opt/src/scripts/extras/vpnupgrade_centos.sh ./vpnup.sh
else
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-amzn
cp -f /opt/src/scripts/extras/vpnupgrade_amzn.sh ./vpnup.sh
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh
@ -482,6 +491,7 @@ jobs:
rm -f /lib/systemd/system/basic.target.wants/*; \
rm -f /lib/systemd/system/anaconda.target.wants/*;
COPY scripts/ /opt/src/scripts/
COPY ./run.sh /opt/src/run.sh
RUN chmod 755 /opt/src/run.sh

View File

@ -23,6 +23,9 @@ jobs:
image: ${{ matrix.os_version }}
options: --cap-add=NET_ADMIN --device=/dev/ppp
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # 2.4.0
with:
persist-credentials: false
- name: Test
run: |
set -ex
@ -70,6 +73,7 @@ jobs:
mkdir -p /opt/src
cd /opt/src
ls -ld "$GITHUB_WORKSPACE/vpnsetup.sh"
echo "# hwdsl2" > run.sh
if [ "$os_type" = "alpine" ]; then
@ -83,7 +87,7 @@ jobs:
service rsyslog start
fi
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
cp -f "$GITHUB_WORKSPACE"/vpnsetup.sh .
sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' vpnsetup.sh
sh vpnsetup.sh
@ -115,7 +119,7 @@ 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
cp -f "$GITHUB_WORKSPACE"/extras/vpnuninstall.sh ./vpnunst.sh
bash vpnunst.sh <<ANSWERS
y
ANSWERS
@ -126,7 +130,7 @@ jobs:
killall xl2tpd || true
fi
wget -t 3 -T 30 -nv -O quickstart.sh https://git.io/vpnquickstart
cp -f "$GITHUB_WORKSPACE"/extras/quickstart.sh .
sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \
-e '/sleep 1/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh' quickstart.sh
@ -172,9 +176,9 @@ jobs:
fi
if [ "$os_type" = "alpine" ]; then
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-alpine
cp -f "$GITHUB_WORKSPACE"/vpnsetup_alpine.sh ./vpnsetup.sh
else
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup-ubuntu
cp -f "$GITHUB_WORKSPACE"/vpnsetup_ubuntu.sh ./vpnsetup.sh
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnsetup.sh
@ -214,7 +218,7 @@ jobs:
ls -l /usr/bin/ikev2.sh
ls -l /opt/src/ikev2.sh
wget -t 3 -T 30 -nv -O ikev2.sh https://git.io/ikev2setup
cp -f "$GITHUB_WORKSPACE"/extras/ikev2setup.sh ./ikev2.sh
sed -i '/swan_ver_latest=/s/^/#/' ikev2.sh
bash ikev2.sh <<ANSWERS
@ -440,7 +444,7 @@ jobs:
restart_ipsec
ipsec status | grep -q ikev2-cp
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade
cp -f "$GITHUB_WORKSPACE"/extras/vpnupgrade.sh ./vpnup.sh
sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpnup.sh"' vpnup.sh
[ "$os_type" = "alpine" ] && ver1=4.5 || ver1=4.4
@ -460,9 +464,9 @@ jobs:
done
if [ "$os_type" = "alpine" ]; then
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-alpine
cp -f "$GITHUB_WORKSPACE"/extras/vpnupgrade_alpine.sh ./vpnup.sh
else
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-ubuntu
cp -f "$GITHUB_WORKSPACE"/extras/vpnupgrade_ubuntu.sh ./vpnup.sh
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh