2020-05-25 18:50:10 +08:00
|
|
|
#for ssl self test
|
|
|
|
|
version: '2.2'
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
|
|
badssl_test:
|
2020-06-24 14:24:44 +08:00
|
|
|
image: "badssl-self-test:latest"
|
2020-05-25 18:50:10 +08:00
|
|
|
container_name: "badssl_ssl_self_test"
|
|
|
|
|
tty: true
|
|
|
|
|
privileged: true
|
|
|
|
|
networks:
|
|
|
|
|
vlan_ssl_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.0.2.130
|
2020-05-25 18:50:10 +08:00
|
|
|
ipv6_address: fd00:a1bf:2c3d:ef5a:1e2f:3d4c:56ab:1010
|
|
|
|
|
bridge_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.51.100.2
|
2020-05-25 18:50:10 +08:00
|
|
|
volumes:
|
|
|
|
|
- /root/.badssl_self_test_cert_dict:/badssl.com/unittest_certs
|
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
|
command: >
|
2020-05-26 14:06:10 +08:00
|
|
|
bash -c "ifconfig eth0 hw ether 02:42:c0:a8:fd:82
|
2020-05-26 17:44:12 +08:00
|
|
|
&& arp -i eth0 -s 192.0.2.3 02:42:C0:A8:FD:03
|
2020-05-25 18:50:10 +08:00
|
|
|
&& make certs-test
|
|
|
|
|
&& make inside-docker
|
|
|
|
|
&& cp -r /badssl.com/certs /badssl.com/unittest_certs
|
|
|
|
|
&& nginx
|
|
|
|
|
&& tail -f /dev/null"
|
|
|
|
|
|
|
|
|
|
wpr_test:
|
2020-06-24 14:24:44 +08:00
|
|
|
image: "wpr-self-test:latest"
|
2020-05-25 18:50:10 +08:00
|
|
|
container_name: "wpr_ssl_self_test"
|
|
|
|
|
tty: true
|
|
|
|
|
privileged: true
|
|
|
|
|
networks:
|
|
|
|
|
vlan_ssl_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.0.2.131
|
2020-05-25 18:50:10 +08:00
|
|
|
ipv6_address: fd00:a1bf:2c3d:ef5a:1e2f:3d4c:56ab:1011
|
|
|
|
|
bridge_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.51.100.3
|
2020-05-25 18:50:10 +08:00
|
|
|
volumes:
|
|
|
|
|
- /root/.go_wpr_test:/root/go_wpr_test
|
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
|
command:
|
|
|
|
|
- /bin/sh
|
|
|
|
|
- -c
|
|
|
|
|
- |
|
2020-05-26 14:06:10 +08:00
|
|
|
ifconfig eth0 hw ether 02:42:C0:A8:FD:83
|
2020-05-26 17:44:12 +08:00
|
|
|
arp -i eth0 -s 192.0.2.3 02:42:C0:A8:FD:03
|
2020-05-25 18:50:10 +08:00
|
|
|
/root/wpr/wpr replay --http_port=80 --https_port=443 --host=0.0.0.0 --quiet_mode /root/wpr/archive.wprgo &
|
|
|
|
|
tail -f /dev/null
|
|
|
|
|
|
|
|
|
|
ssl_unittest:
|
2020-06-24 14:24:44 +08:00
|
|
|
image: "unittest-self-test:latest"
|
2020-05-25 18:50:10 +08:00
|
|
|
container_name: "unittest_ssl_self_test"
|
|
|
|
|
depends_on:
|
|
|
|
|
- badssl_test
|
|
|
|
|
- wpr_test
|
|
|
|
|
tty: true
|
|
|
|
|
privileged: true
|
|
|
|
|
networks:
|
|
|
|
|
vlan_unittest_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.0.2.3
|
2020-05-25 18:50:10 +08:00
|
|
|
ipv6_address: fd00:a1bf:2c3d:ef5b:6e7f:8d9c:abfe:1012
|
|
|
|
|
bridge_net:
|
2020-05-26 17:44:12 +08:00
|
|
|
ipv4_address: 192.51.100.4
|
2020-05-25 18:50:10 +08:00
|
|
|
volumes:
|
|
|
|
|
- /root/.badssl_self_test_cert_dict:/root/cafile_dict
|
2020-05-26 10:43:17 +08:00
|
|
|
- /root/.result_self_test:/root/result_self_test
|
2020-05-25 18:50:10 +08:00
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
|
command:
|
|
|
|
|
- /bin/sh
|
|
|
|
|
- -c
|
|
|
|
|
- |
|
2020-05-26 17:44:12 +08:00
|
|
|
/root/unittest/wait-for 192.51.100.2:443 -t 60 -- echo "badssl is up"
|
|
|
|
|
/root/unittest/wait-for 192.51.100.3:443 -t 60 -- echo "wpr is up"
|
2020-05-26 14:06:10 +08:00
|
|
|
ifconfig eth0 hw ether 02:42:C0:A8:FD:03
|
2020-05-26 17:44:12 +08:00
|
|
|
arp -i eth0 -s 192.0.2.130 02:42:c0:a8:fd:82
|
|
|
|
|
arp -i eth0 -s 192.0.2.131 02:42:C0:A8:FD:83
|
2020-05-27 13:45:00 +08:00
|
|
|
mkdir -p /root/result_self_test/unittest
|
|
|
|
|
mkdir -p /root/result_self_test/con_traffic_inject
|
2020-05-25 18:50:10 +08:00
|
|
|
cp -rf /root/cafile_dict/certs/sets/current/gen/crt/ca-root.crt /usr/local/share/ca-certificates
|
|
|
|
|
update-ca-certificates
|
|
|
|
|
cat /root/unittest/badssl.test.hosts >> /etc/hosts
|
2020-05-26 23:06:50 +08:00
|
|
|
python /root/unittest/unittest_self.py &
|
2020-05-25 18:50:10 +08:00
|
|
|
tail -f /dev/null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
bridge_net:
|
|
|
|
|
name: bridge_ssl_self_test_net
|
|
|
|
|
driver: bridge
|
|
|
|
|
ipam:
|
|
|
|
|
config:
|
2020-05-26 17:44:12 +08:00
|
|
|
- subnet: 192.51.100.0/24
|
|
|
|
|
gateway: 192.51.100.1
|
2020-05-25 18:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
vlan_ssl_net:
|
|
|
|
|
name: vlan_ssl_self_test_net
|
|
|
|
|
driver: macvlan
|
|
|
|
|
enable_ipv6: true
|
|
|
|
|
driver_opts:
|
|
|
|
|
parent: enp1s1
|
|
|
|
|
ipam:
|
|
|
|
|
config:
|
2020-05-26 17:44:12 +08:00
|
|
|
- subnet: 192.0.2.0/24
|
|
|
|
|
ip_range: 192.0.2.128/25
|
|
|
|
|
gateway: 192.0.2.129
|
2020-05-25 18:50:10 +08:00
|
|
|
- subnet: fd00:a1bf:2c3d:ef5a::/63
|
|
|
|
|
ip_range: fd00:a1bf:2c3d:ef5a::/64
|
|
|
|
|
gateway: fd00:a1bf:2c3d:ef5a::1010
|
|
|
|
|
|
|
|
|
|
vlan_unittest_net:
|
|
|
|
|
name: vlan_unittest_self_test_net
|
|
|
|
|
driver: macvlan
|
|
|
|
|
enable_ipv6: true
|
|
|
|
|
driver_opts:
|
|
|
|
|
parent: ens1f1
|
|
|
|
|
ipam:
|
|
|
|
|
config:
|
2020-05-26 17:44:12 +08:00
|
|
|
- subnet: 192.0.2.0/24
|
|
|
|
|
ip_range: 192.0.2.0/25
|
|
|
|
|
gateway: 192.0.2.1
|
2020-05-25 18:50:10 +08:00
|
|
|
- subnet: fd00:a1bf:2c3d:ef5a::/63
|
|
|
|
|
ip_range: fd00:a1bf:2c3d:ef5b::/64
|
|
|
|
|
gateway: fd00:a1bf:2c3d:ef5a::1011
|