-
-
Notifications
You must be signed in to change notification settings - Fork 288
124 lines (88 loc) · 2.61 KB
/
test_set_3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# Copyright (C) 2022-2024 Lin Song <linsongui@gmail.com>
name: test_set_3
on: workflow_call
jobs:
test_set_3:
if: github.repository_owner == 'hwdsl2'
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Test
run: |
set -ex
mkdir -p /opt/src
cd /opt/src
ls -ld "$GITHUB_WORKSPACE/wireguard-install.sh"
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -yqq update
sudo apt-get -yqq dist-upgrade
sudo apt-get -yqq install wget
cp -f "$GITHUB_WORKSPACE"/wireguard-install.sh ./wireguard.sh
sudo bash wireguard.sh --auto
sudo netstat -anpu | grep ':51820'
sudo systemctl status wg-quick@wg0
ls -ld ~/client.conf
sudo bash wireguard.sh <<ANSWERS
1
client2
ANSWERS
ls -ld ~/client2.conf
sudo bash wireguard.sh <<ANSWERS
2
ANSWERS
sudo bash wireguard.sh <<ANSWERS | grep -i "2 clients"
2
ANSWERS
sudo bash wireguard.sh <<ANSWERS
3
2
y
ANSWERS
ls -ld ~/client2.conf && exit 1
sudo bash wireguard.sh <<ANSWERS | grep -i "1 client"
2
ANSWERS
sudo bash wireguard.sh <<ANSWERS
4
1
ANSWERS
sudo bash wireguard.sh <<ANSWERS
5
y
ANSWERS
sudo netstat -anpu | grep ':51820' && exit 1
rm -f ~/client*.conf
sudo bash wireguard.sh <<ANSWERS
ANSWERS
sudo netstat -anpu | grep ':51820'
sudo systemctl status wg-quick@wg0
ls -ld ~/client.conf
sudo bash wireguard.sh <<ANSWERS
5
y
ANSWERS
sudo netstat -anpu | grep ':51820' && exit 1
rm -f ~/client*.conf
sudo bash wireguard.sh <<ANSWERS
y
invalidfqdn
vpn.example.com
ANSWERS
sudo netstat -anpu | grep ':51820'
sudo systemctl status wg-quick@wg0
ls -ld ~/client.conf
sudo grep -q 'ENDPOINT vpn.example.com' /etc/wireguard/wg0.conf
grep -q 'Endpoint = vpn.example.com:51820' ~/client.conf
sudo bash wireguard.sh <<ANSWERS
5
y
ANSWERS
sudo netstat -anpu | grep ':51820' && exit 1
rm -f ~/client*.conf