diff options
author | misuzu <bakalolka@gmail.com> | 2020-01-02 14:22:48 +0200 |
---|---|---|
committer | misuzu <bakalolka@gmail.com> | 2020-01-02 14:25:20 +0200 |
commit | 9980eb8734784d006af4e54eac46532daeb9862e (patch) | |
tree | cb8f3806819fa79a2f083a5dfd00f7433d368af2 /nixos/tests/3proxy.nix | |
parent | 2ff742e970dedce68fb8a2c1374ea1aaa3f8e686 (diff) | |
download | nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar.gz nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar.bz2 nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar.lz nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar.xz nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.tar.zst nixpkgs-9980eb8734784d006af4e54eac46532daeb9862e.zip |
nixosTests.3proxy: port test to python
Diffstat (limited to 'nixos/tests/3proxy.nix')
-rw-r--r-- | nixos/tests/3proxy.nix | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index b8e1dac0e89..3e2061d7e42 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, ...} : { +import ./make-test-python.nix ({ pkgs, ...} : { name = "3proxy"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ misuzu ]; @@ -134,29 +134,52 @@ import ./make-test.nix ({ pkgs, ...} : { }; testScript = '' - startAll; - - $peer1->waitForUnit("3proxy.service"); + peer1.wait_for_unit("3proxy.service") + peer1.wait_for_open_port("9999") # test none auth - $peer0->succeed("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://216.58.211.112:9999"); - $peer0->succeed("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://192.168.0.2:9999"); - $peer0->succeed("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://127.0.0.1:9999"); + peer0.succeed( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://216.58.211.112:9999" + ) + peer0.succeed( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://192.168.0.2:9999" + ) + peer0.succeed( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://127.0.0.1:9999" + ) - $peer2->waitForUnit("3proxy.service"); + peer2.wait_for_unit("3proxy.service") + peer2.wait_for_open_port("9999") # test iponly auth - $peer0->succeed("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://216.58.211.113:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://192.168.0.3:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://127.0.0.1:9999"); + peer0.succeed( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://216.58.211.113:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://192.168.0.3:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://127.0.0.1:9999" + ) - $peer3->waitForUnit("3proxy.service"); + peer3.wait_for_unit("3proxy.service") + peer3.wait_for_open_port("9999") # test strong auth - $peer0->succeed("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999"); - $peer0->fail("${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://127.0.0.1:9999"); + peer0.succeed( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999" + ) + peer0.fail( + "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://127.0.0.1:9999" + ) ''; }) |