Example #1
0
                skid = lines[i + 1].decode("utf-8").split()[-1].replace(
                    ":", " ").upper()
                break
        return skid

    def _rel(self, path: pathlib.Path):
        return path.relative_to(pathlib.Path(self.test_state.artifacts))

    def _to_as_dir(self, isd_as: ISD_AS) -> pathlib.Path:
        return pathlib.Path("%s/gen/AS%s" %
                            (self.test_state.artifacts, isd_as.as_file_fmt()))

    def _cs_configs(self) -> List[pathlib.Path]:
        return list(
            pathlib.Path("%s/gen" %
                         self.test_state.artifacts).glob("AS*/cs*.toml"))

    def _local_flags(self, isd_as: ISD_AS) -> List[str]:
        return [
            "--local",
            self.execute("tester_%s" % isd_as.file_fmt(), "sh", "-c",
                         "echo $SCION_LOCAL_ADDR").strip(),
        ]


if __name__ == "__main__":
    base.register_commands(Test)
    base.TestBase.test_state = base.TestState(scion.SCIONDocker(),
                                              docker.Compose())
    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()
Example #3
0
    Tests that IP pinging between Gateways works.
    """
    gateway_acceptance = plumbum.cli.SwitchAttr(
        "gateway_acceptance",
        str,
        default="./bin/sig_ping_acceptance",
        help="The gateway ping acceptance binary" +
        " (default: ./bin/sig_ping_acceptance)")

    def main(self):
        if not self.nested_command:
            try:
                self.setup()
                time.sleep(20)
                self._run()
            finally:
                self.teardown()

    def _run(self):
        ping_test = plumbum.local[self.gateway_acceptance]

        print("Running ping test")
        print(ping_test("-d", "-outDir", self.test_state.artifacts))
        print("Ping done")


if __name__ == "__main__":
    base.register_commands(Test)
    Test.test_state = base.TestState(scion.SCIONDocker(), docker.Compose())
    Test.run()
Example #4
0
 def init(self):
     super().init()
     self.dc = docker.Compose(compose_file=self.artifacts /
                              "gen/scion-dc.yml")