From 9151e32e2b6f32a7563668dc5cd0e0f70eaef5bd Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 9 Mar 2021 14:29:49 -0500 Subject: [PATCH] system-tests: improve lava slave ssh capability The current lava slave setup does not permit easy access to the running slave once the job is started. This can be cumbersome when a hang happens. To ease access, setup ssh with authorized keys for the root user. This is only accessible from internal network. Split the env setup in two: base and vlttng. Signed-off-by: Jonathan Rajotte --- lava/system-tests/authorized_keys | 2 ++ lava/system-tests/setup.yaml | 27 +++++++++++++++++++ scripts/system-tests/template_lava_job.jinja2 | 22 +++++---------- 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 lava/system-tests/authorized_keys create mode 100644 lava/system-tests/setup.yaml diff --git a/lava/system-tests/authorized_keys b/lava/system-tests/authorized_keys new file mode 100644 index 0000000..2a53530 --- /dev/null +++ b/lava/system-tests/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwkSh8Eiip4aqnUtKjo8WpdDrktmg89Jhbi8XrJy5UY9KmFQqV5Gy5YVfRveWmFZlHliRbWuxKhvpQ0XslaqeXSG/xwrVBtrfv3nw88a3txXClDZom6yBm5JIYxgNiPVYF+Pf64Jke7vNjJkAXSL6J2/wsKKGCsyAveI7ydhbRK1A/oEdG3E1R9Aukh4JYtPbuHxfLpleAc+S4tdZPeRPO+uNhDvw1XvNfWlk34rmohkaLMnp6tCwggk4zCYbhwHo9/UlS2Pb4AlBD9bto+9pi8E5PoYu/rB8rUe48iMZpYCKA153uQNibt7VCV13aCf3edzD1Df0MtJFRWZ+1cSHr joraj-efficios +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgXxRLBKUwG8F/X9/RI3cNWOETFhXSxY2WIcnMvHCxphAOCOuX3XjZ5H5pOSI5uCrGhDGNX32I9ie7A3sgwUbw/Em8hSBF9DG4gUACl/4H1cKgG4qE9vd0j4ocHhJU15C03RDG87P0ecIeDuWVwVjLtylJConcZhRTnzuOVO4qkdlHvDY5M7ELTCprZHI+OhlWBquL829bRnZE9evdyGOYv9XHeVVjzHlpbLd0WkviNgumcYSuM16R7WvjGkjz80wp97UqWsaE/JIb87L10i5ByFGRqTmB+6gBhIuO1c37KhBULeOQVGumxQY68x9tRgLMlQmhcWJQ+dtPl4UELQHV jeremie.galarneau@efficios.com diff --git a/lava/system-tests/setup.yaml b/lava/system-tests/setup.yaml new file mode 100644 index 0000000..34c23c3 --- /dev/null +++ b/lava/system-tests/setup.yaml @@ -0,0 +1,27 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: x86-env-setup + description: "Basic environment setup for x86 board" + os: + - ubuntu + devices: + - x86 +run: + steps: + - git clone https://github.com/lttng/lttng-ci ci + - chmod 755 / + - systemctl start systemd-timesyncd + - echo nameserver 172.18.0.12 > /etc/resolv.conf + - ip a + - groupadd tracing + - depmod -a + - locale-gen en_US.UTF-8 + - apt-get update + - apt-get upgrade + - apt-get install -y systemtap-sdt-dev openssh-server + - pip3 install 'pip==20.3' + - hash -r + - pip3 install vlttng + - cp lava/system-tests/authorized_keys /root/.ssh/authorized_keys + - chmod 600 /root/.ssh/authorized_keys + - sync diff --git a/scripts/system-tests/template_lava_job.jinja2 b/scripts/system-tests/template_lava_job.jinja2 index ded42e9..95ec1eb 100644 --- a/scripts/system-tests/template_lava_job.jinja2 +++ b/scripts/system-tests/template_lava_job.jinja2 @@ -59,7 +59,12 @@ actions: - test: definitions: - # Base setup of environment # + # Base setup # + - repository: https://github.com/lttng/lttng-ci.git + from: git + path: lava/system-tests/setup.yml + name: x86-env-setup + # Base vlttng setup # - repository: metadata: format: Lava-Test Test Definition 1.0 @@ -71,30 +76,17 @@ actions: - x86 run: steps: - - chmod 755 / - - systemctl start systemd-timesyncd - - echo nameserver 172.18.0.12 > /etc/resolv.conf - - ip a - - groupadd tracing {% if device_type == DeviceType.x86 %} - mount /dev/sda1 /tmp {% elif device_type == DeviceType.kvm %} - mount /dev/sda /tmp {% endif %} - rm -rf /tmp/* - - depmod -a - - locale-gen en_US.UTF-8 - - apt-get update - - apt-get upgrade - - apt-get install -y systemtap-sdt-dev - - pip3 install 'pip==20.3' - - hash -r - - pip3 install vlttng - {{ vlttng_cmd }} - ln -s {{ vlttng_path }} /root/lttngvenv - sync from: inline - name: x86-env-setup-inline + name:vlttng-env-setup-inline path: inline/x86-env-setup.yaml {% if test_type == TestType.baremetal_tests %} - repository: https://github.com/lttng/lttng-ci.git -- 2.34.1