Beispiel #1
0
 def test_vdbench_run(self, test_vars):  # noqa: F811
     log = logging.getLogger("test_vdbench_run")
     node_ip = test_vars["deploy_vd_outputs"]["node_0_ip_address"]["value"]
     with SSHTunnelForwarder(
             test_vars["public_ip"],
             ssh_username=test_vars["controller_user"],
             ssh_pkey=test_vars["ssh_priv_key"],
             remote_bind_address=(node_ip, 22),
     ) as ssh_tunnel:
         sleep(1)
         try:
             ssh_client = create_ssh_client(
                 test_vars["controller_user"],
                 "127.0.0.1",
                 ssh_tunnel.local_bind_port,
                 key_filename=test_vars["ssh_priv_key"])
             scp_client = SCPClient(ssh_client.get_transport())
             try:
                 scp_client.put(test_vars["ssh_priv_key"], r"~/.ssh/id_rsa")
             finally:
                 scp_client.close()
             commands = """
                 ~/copy_idrsa.sh
                 cd
                 ./run_vdbench.sh inmem32node3.conf uniquestring1
                 """.split("\n")
             run_ssh_commands(ssh_client, commands)
         finally:
             ssh_client.close()
Beispiel #2
0
 def test_edasim_run(self, test_vars):  # noqa: F811
     log = logging.getLogger("test_edasim_run")
     node_ip = test_vars["deploy_edasim_outputs"][
         "jobsubmitter_0_ip_address"]["value"]
     with SSHTunnelForwarder(
             test_vars["public_ip"],
             ssh_username=test_vars["controller_user"],
             ssh_pkey=test_vars["ssh_priv_key"],
             remote_bind_address=(node_ip, 22),
     ) as ssh_tunnel:
         sleep(1)
         try:
             ssh_client = create_ssh_client(
                 test_vars["controller_user"],
                 "127.0.0.1",
                 ssh_tunnel.local_bind_port,
                 key_filename=test_vars["ssh_priv_key"])
             run_ssh_command(ssh_client,
                             ". .profile && ./jobrun.sh testrun")
         finally:
             ssh_client.close()
Beispiel #3
0
    def test_client_docker_run(self, test_vars):  # noqa: F811
        log = logging.getLogger("test_client_docker_run")
        node_ip = test_vars["deploy_client_docker_outputs"]["node_0_ip_address"]["value"]
        atd = test_vars["atd_obj"]
        cluster_mgmt_ip = test_vars["cluster_mgmt_ip"]
        with SSHTunnelForwarder(
            test_vars["public_ip"],
            ssh_username=test_vars["controller_user"],
            ssh_pkey=test_vars["ssh_priv_key"],
            remote_bind_address=(node_ip, 22),
        ) as ssh_tunnel:
            sleep(1)
            try:
                ssh_client = create_ssh_client(
                    test_vars["controller_user"],
                    "127.0.0.1",
                    ssh_tunnel.local_bind_port,
                    key_filename=test_vars["ssh_priv_key"]
                )
                scp_client = SCPClient(ssh_client.get_transport())
                try:
                    scp_client.put(test_vars["ssh_priv_key"], r"~/.ssh/id_rsa")
                finally:
                    scp_client.close()
                commands = """
                    cd
                    curl -fsSL https://get.docker.com -o get-docker.sh
                    sudo sh get-docker.sh
                    sudo docker login https://{0} -u {1} -p {2}
                    sudo docker pull {0}/test

                    echo "export STORAGEACT='{3}'" >> ~/.bashrc
                    echo "export MGMIP='{4}'" >> ~/.bashrc
                    echo "export SA_KEY='{5}'" >> ~/.bashrc
                    echo "export CLUSTER_MGMT_IP='{6}'" >> ~/.bashrc
                    echo "export ADMIN_PW='{7}'" >> ~/.bashrc
                    """.format(os.environ["dockerRegistry"], os.environ["dockerUsername"], os.environ["dockerPassword"], atd.deploy_id + "sa", test_vars["public_ip"], os.environ["SA_KEY"], cluster_mgmt_ip, os.environ["AVERE_ADMIN_PW"]).split("\n")
                run_ssh_commands(ssh_client, commands)
            finally:
                ssh_client.close()