예제 #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()
예제 #2
0
파일: test.py 프로젝트: JordiSubira/scion
    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()
예제 #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()