1
0
mirror of synced 2024-11-30 00:26:04 +03:00

Update tests

This commit is contained in:
hwdsl2 2021-08-07 02:15:11 -05:00
parent 1b1c1ecc8f
commit 688a700fd6
2 changed files with 12 additions and 30 deletions

View File

@ -89,7 +89,7 @@ jobs:
cat > run.sh <<'EOF' cat > run.sh <<'EOF'
#!/bin/bash #!/bin/bash
set -e set -eEx
log1=/var/log/secure log1=/var/log/secure
log2=/var/log/messages log2=/var/log/messages
@ -103,10 +103,9 @@ jobs:
} }
restart_ipsec() { restart_ipsec() {
sed -i '/pluto/d' "$log1" if ! command -v amazon-linux-extras; then
pkill -HUP rsyslog
systemctl restart ipsec systemctl restart ipsec
sleep 1 fi
echo "Waiting for IPsec to restart." echo "Waiting for IPsec to restart."
count=0 count=0
while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do
@ -402,9 +401,6 @@ jobs:
restart_ipsec restart_ipsec
ipsec status | grep -q ikev2-cp ipsec status | grep -q ikev2-cp
sed -i '/pluto/d' "$log1"
pkill -HUP rsyslog
if [ "$1" != "amazon" ]; then if [ "$1" != "amazon" ]; then
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos
else else
@ -506,14 +502,12 @@ jobs:
steps: steps:
- name: Test - name: Test
run: | run: |
set -ex
log1=/var/log/auth.log log1=/var/log/auth.log
log2=/var/log/syslog log2=/var/log/syslog
restart_ipsec() { restart_ipsec() {
sed -i '/pluto/d' "$log1"
pkill -HUP rsyslog
service ipsec restart
sleep 1
echo "Waiting for IPsec to restart." echo "Waiting for IPsec to restart."
count=0 count=0
while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do
@ -811,9 +805,6 @@ jobs:
restart_ipsec restart_ipsec
ipsec status | grep -q ikev2-cp 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 wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh

View File

@ -118,7 +118,7 @@ jobs:
cat > run.sh <<'EOF' cat > run.sh <<'EOF'
#!/bin/bash #!/bin/bash
set -e set -eEx
log1=/var/log/secure log1=/var/log/secure
log2=/var/log/messages log2=/var/log/messages
@ -132,10 +132,9 @@ jobs:
} }
restart_ipsec() { restart_ipsec() {
sed -i '/pluto/d' "$log1" if ! command -v amazon-linux-extras; then
pkill -HUP rsyslog
systemctl restart ipsec systemctl restart ipsec
sleep 1 fi
echo "Waiting for IPsec to restart." echo "Waiting for IPsec to restart."
count=0 count=0
while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do
@ -431,9 +430,6 @@ jobs:
restart_ipsec restart_ipsec
ipsec status | grep -q ikev2-cp ipsec status | grep -q ikev2-cp
sed -i '/pluto/d' "$log1"
pkill -HUP rsyslog
if [ "$1" != "amazon" ]; then if [ "$1" != "amazon" ]; then
wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade-centos
else else
@ -535,14 +531,12 @@ jobs:
steps: steps:
- name: Test - name: Test
run: | run: |
set -ex
log1=/var/log/auth.log log1=/var/log/auth.log
log2=/var/log/syslog log2=/var/log/syslog
restart_ipsec() { restart_ipsec() {
sed -i '/pluto/d' "$log1"
pkill -HUP rsyslog
service ipsec restart
sleep 1
echo "Waiting for IPsec to restart." echo "Waiting for IPsec to restart."
count=0 count=0
while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do
@ -840,9 +834,6 @@ jobs:
restart_ipsec restart_ipsec
ipsec status | grep -q ikev2-cp 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 wget -t 3 -T 30 -nv -O vpnup.sh https://git.io/vpnupgrade
sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh sed -i '/swan_ver_latest=/s/^/#/' vpnup.sh