Skip to content

Commit

Permalink
test: add test script for wifidogx
Browse files Browse the repository at this point in the history
Signed-off-by: staylightblow8 <[email protected]>
  • Loading branch information
liudf0716 committed Jan 4, 2024
1 parent ef28150 commit fec4f43
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 29 deletions.
29 changes: 0 additions & 29 deletions doc/wifidogx.conf

This file was deleted.

10 changes: 10 additions & 0 deletions test/aw_fw4.nft
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

sudo nft delete table inet fw4

sudo nft add table inet fw4

sudo nft add chain inet fw4 mangle_prerouting
sudo nft add chain inet fw4 mangle_postrouting
sudo nft add chain inet fw4 accept_to_wan
sudo nft add chain inet fw4 dstnat
Binary file added test/wdctlx
Binary file not shown.
33 changes: 33 additions & 0 deletions test/wdctlx_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

echo "#################"
echo " add trusted iplist "
./wdctlx add_trusted_iplist 192.168.1.2,192.168.1.3,192.168.1.4,192.168.1.5
./wdctlx status
echo "add trusted iplist 192.1168.1.6"
./wdctlx add_trusted_iplist 192.168.1.6
./wdctlx status
echo "del trusted iplist 192.1168.1.6"
./wdctlx del_trusted_iplist 192.168.1.6
./wdctlx status
echo "del trusted iplist 192.1168.1.3,192.1168.1.5"
./wdctlx del_trusted_iplist 192.168.1.3,192.168.1.5
./wdctlx status
echo "clear trusted iplist"
./wdctlx clear_trusted_iplist
./wdctlx status

echo "#################"
echo " add trusted mac "
./wdctlx add_trusted_mac aa:bb:cc:11:22:33,11:22:33:aa:bb:cc,22.22.22:aa:aa:aa,33:33:33:33:33:ab,44:44:44:44:44:44,55:55:55:55:55:55
./wdctlx show_trusted_mac
echo "del trusted mac 11:22:33:aa:bb:cc"
./wdctlx del_trusted_mac 11:22:33:aa:bb:cc
./wdctlx show_trusted_mac
echo "del trusted mac 55:55:55:55:55:55,33:33:33:33:33:ab"
./wdctlx del_trusted_mac 55:55:55:55:55:55,33:33:33:33:33:ab
./wdctlx show_trusted_mac
echo "clear trusted mac"
./wdctlx clear_trusted_mac
./wdctlx show_trusted_mac

6 changes: 6 additions & 0 deletions test/wdctlx_test_add_auth_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "#################"
echo " add_auth_client "
./wdctlx add_auth_client "{\"ip\":\"192.168.1.212\",\"mac\":\"aa:bb:cc:dd:ee:1f\",\"name\":\"apfree2\"}"
./wdctlx status
6 changes: 6 additions & 0 deletions test/wdctlx_test_add_online_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "#################"
echo " add roam client "
./wdctlx add_online_client "{\"ip\":\"192.168.1.211\",\"mac\":\"aa:bb:cc:dd:ee:ff\",\"name\":\"apfree\"}"
./wdctlx status
19 changes: 19 additions & 0 deletions test/wdctlx_test_domain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

echo "#################"
echo " add trusted domains "
./wdctlx add_trusted_domains captive.apple.com,www.baidu.com,www.qq.com,www.alibaba.com,aaa,bbb
./wdctlx show_trusted_domains
sleep 1
echo "del trusted domains aaa"
./wdctlx del_trusted_domains aaa
./wdctlx show_trusted_domains
sleep 1
echo "del trusted domains www.baidu.com,www.qq.com"
./wdctlx del_trusted_domains www.baidu.com,www.qq.com
./wdctlx show_trusted_domains
echo "clear trusted domains"
sleep 1
./wdctlx clear_trusted_domains
./wdctlx show_trusted_domains
echo "#################"
11 changes: 11 additions & 0 deletions test/wifidogx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
GatewayID ABCDEF112234
GatewayInterface ens256

AuthServer {
Hostname 172.21.169.223
HTTPPort 8001
Path /wifidog/
}

ClientTimeout 5

0 comments on commit fec4f43

Please sign in to comment.