From 688a700fd6386af9e2515d6981f839606ca8f729 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sat, 7 Aug 2021 02:15:11 -0500 Subject: [PATCH] Update tests --- .github/workflows/cron.yml | 21 ++++++--------------- .github/workflows/main.yml | 21 ++++++--------------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 01b752b..74ba7c2 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -89,7 +89,7 @@ jobs: cat > run.sh <<'EOF' #!/bin/bash - set -e + set -eEx log1=/var/log/secure log2=/var/log/messages @@ -103,10 +103,9 @@ jobs: } restart_ipsec() { - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - systemctl restart ipsec - sleep 1 + if ! command -v amazon-linux-extras; then + systemctl restart ipsec + fi echo "Waiting for IPsec to restart." count=0 while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do @@ -402,9 +401,6 @@ jobs: restart_ipsec ipsec status | grep -q ikev2-cp - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - if [ "$1" != "amazon" ]; then wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos else @@ -506,14 +502,12 @@ jobs: steps: - name: Test run: | + set -ex + log1=/var/log/auth.log log2=/var/log/syslog restart_ipsec() { - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - service ipsec restart - sleep 1 echo "Waiting for IPsec to restart." count=0 while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do @@ -811,9 +805,6 @@ jobs: restart_ipsec ipsec status | grep -q ikev2-cp - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b097f94..ebbe4c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -118,7 +118,7 @@ jobs: cat > run.sh <<'EOF' #!/bin/bash - set -e + set -eEx log1=/var/log/secure log2=/var/log/messages @@ -132,10 +132,9 @@ jobs: } restart_ipsec() { - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - systemctl restart ipsec - sleep 1 + if ! command -v amazon-linux-extras; then + systemctl restart ipsec + fi echo "Waiting for IPsec to restart." count=0 while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do @@ -431,9 +430,6 @@ jobs: restart_ipsec ipsec status | grep -q ikev2-cp - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - if [ "$1" != "amazon" ]; then wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos else @@ -535,14 +531,12 @@ jobs: steps: - name: Test run: | + set -ex + log1=/var/log/auth.log log2=/var/log/syslog restart_ipsec() { - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - service ipsec restart - sleep 1 echo "Waiting for IPsec to restart." count=0 while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do @@ -840,9 +834,6 @@ jobs: restart_ipsec ipsec status | grep -q ikev2-cp - sed -i '/pluto/d' "$log1" - pkill -HUP rsyslog - wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh