Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hwdsl2 committed Oct 15, 2024
1 parent 9442981 commit 052e07b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
if: github.repository_owner == 'hwdsl2'
uses: ./.github/workflows/check_urls.yml

test_set_1:
needs: check_urls
uses: ./.github/workflows/test_set_1.yml

test_set_2:
needs: check_urls
uses: ./.github/workflows/test_set_2.yml
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ on:
- '**.sh'
- '.github/workflows/main.yml'
- '.github/workflows/shellcheck.yml'
- '.github/workflows/test_set_1.yml'
- '.github/workflows/test_set_2.yml'

jobs:
shellcheck:
if: github.repository_owner == 'hwdsl2'
uses: ./.github/workflows/shellcheck.yml

test_set_1:
needs: shellcheck
uses: ./.github/workflows/test_set_1.yml

test_set_2:
needs: shellcheck
uses: ./.github/workflows/test_set_2.yml
8 changes: 4 additions & 4 deletions .github/workflows/test_set_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@ jobs:
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.14 ""; do
for ver in 4.15 ""; do
sed -i "s/^SWAN_VER=.*/SWAN_VER=$ver/" vpnup.sh
bash vpnup.sh <<ANSWERS
ANSWERS
restart_ipsec
[ -z "$ver" ] && ver=5.0
[ -z "$ver" ] && ver=5.1
ipsec --version | grep "$ver"
ipsec status | grep -q l2tp-psk
ipsec status | grep -q xauth-psk
Expand All @@ -538,13 +538,13 @@ jobs:
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh
for ver in 4.15 ""; do
for ver in 5.0 ""; do
sed -i "s/^SWAN_VER=.*/SWAN_VER=$ver/" vpnup.sh
bash vpnup.sh <<ANSWERS
ANSWERS
restart_ipsec
[ -z "$ver" ] && ver=5.0
[ -z "$ver" ] && ver=5.1
ipsec --version | grep "$ver"
ipsec status | grep -q l2tp-psk
ipsec status | grep -q xauth-psk
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_set_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ jobs:
cp -f "$GITHUB_WORKSPACE"/extras/vpnupgrade.sh ./vpnup.sh
sed -i '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpnup.sh"' vpnup.sh
for ver in 4.14 ""; do
for ver in 4.15 ""; do
if [ "$os_type" = "alpine" ] \
|| grep -qs trixie /etc/debian_version; then
ipsec whack --shutdown || true
Expand All @@ -504,7 +504,7 @@ jobs:
ANSWERS
restart_ipsec
[ -z "$ver" ] && ver=5.0
[ -z "$ver" ] && ver=5.1
ipsec --version | grep "$ver"
ipsec status | grep -q l2tp-psk
ipsec status | grep -q xauth-psk
Expand All @@ -518,7 +518,7 @@ jobs:
fi
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh
for ver in 4.15 ""; do
for ver in 5.0 ""; do
if [ "$os_type" = "alpine" ] \
|| grep -qs trixie /etc/debian_version; then
ipsec whack --shutdown || true
Expand All @@ -528,7 +528,7 @@ jobs:
ANSWERS
restart_ipsec
[ -z "$ver" ] && ver=5.0
[ -z "$ver" ] && ver=5.1
ipsec --version | grep "$ver"
ipsec status | grep -q l2tp-psk
ipsec status | grep -q xauth-psk
Expand Down

0 comments on commit 052e07b

Please sign in to comment.