Example #1
0
    def _showpaths_bidirectional(self, source: str, destination: str,
                                 retcode: int):
        self._showpaths_run(source, destination, retcode)
        self._showpaths_run(destination, source, retcode)

    def _showpaths_run(self, source_as: str, destination_as: str,
                       retcode: int):
        print(
            cmd.docker("exec",
                       "-t",
                       self._testers[source_as],
                       "scion",
                       "sp",
                       self._ases[destination_as],
                       "--timeout",
                       "2s",
                       retcode=retcode))


def configuration_server(server):
    print("HTTP configuration server starting on %s:%d." %
          server.server_address)
    server.serve_forever()
    print("HTTP configuration server closed.")


if __name__ == "__main__":
    base.register_commands(Test)
    Test.test_state = base.TestState(scion.SCIONDocker(), tools.DC())
    Test.run()
Example #2
0
            bfd_arg = "--bfd"
        sudo("%s --artifacts %s %s" %
             (self.braccept_bin, self.test_state.artifacts, bfd_arg))

    def teardown(self):
        cmd.docker["logs", "router"] & FG
        exec_docker("rm -f router")
        exec_docker("rm -f pause")  # veths are deleted automatically
        sudo("chown -R %s %s" % (cmd.whoami(), self.test_state.artifacts))

    def create_veths(self, ns: str):
        create_veth("veth_int_host", "veth_int", "192.168.0.11/24",
                    "f0:0d:ca:fe:00:01", ns, [
                        "192.168.0.12", "192.168.0.13", "192.168.0.14",
                        "192.168.0.51", "192.168.0.61", "192.168.0.71"
                    ])
        create_veth("veth_121_host", "veth_121", "192.168.12.2/31",
                    "f0:0d:ca:fe:00:12", ns, ["192.168.12.3"])
        create_veth("veth_131_host", "veth_131", "192.168.13.2/31",
                    "f0:0d:ca:fe:00:13", ns, ["192.168.13.3"])
        create_veth("veth_141_host", "veth_141", "192.168.14.2/31",
                    "f0:0d:ca:fe:00:14", ns, ["192.168.14.3"])
        create_veth("veth_151_host", "veth_151", "192.168.15.2/31",
                    "f0:0d:ca:fe:00:15", ns, ["192.168.15.3"])


if __name__ == "__main__":
    base.register_commands(RouterTest)
    base.TestBase.test_state = base.TestState(None, docker.Compose())
    RouterTest.run()