Esempio n. 1
0
    def test_unroute_network_tor(self, mr):
        route = Route(FakeTask(), FakeMachine())
        route.route = "tor"
        route.unroute_network()

        mr.assert_has_calls([
            mock.call(
                "proxy_disable", "192.168.56.10", "192.168.56.1", "5353",
                "9040"
            )
        ])
Esempio n. 2
0
    def test_unroute_network_inetsim(self, mr):
        route = Route(FakeTask(), FakeMachine())
        route.route = "inetsim"
        route.unroute_network()

        mr.assert_has_calls([
            mock.call(
                "inetsim_disable", "192.168.56.10", "192.168.56.1", "vboxnet0",
                "2042", ""
            )
        ])
Esempio n. 3
0
    def test_unroute_network_socks5(self, mr):
        route = Route(FakeTask(), FakeMachine())
        route.route = "socks5"
        route.task.options["socks5.localport"] = 4242
        route.unroute_network()

        mr.assert_has_calls([
            mock.call(
                "proxy_disable", "192.168.56.10", "192.168.56.1", "53",
                "4242",
            )
        ])
Esempio n. 4
0
    def test_unroute_network_vpn(self, mr):
        route = Route(FakeTask(), FakeMachine())
        route.route = "vpn0"
        route.unroute_network()
        route.rt_table = "tun0"
        route.interface = "tun0"
        route.unroute_network()

        mr.assert_has_calls([
            mock.call("forward_disable", "tap0", "tun0", "192.168.56.10"),
            mock.call("srcroute_disable", "tun0", "192.168.56.10"),
        ])
Esempio n. 5
0
    def test_unroute_network_none(self, mr):
        route = Route(FakeTask(), FakeMachine())
        route.route = "none"
        route.unroute_network()

        mr.assert_not_called()