system-tests: improve lava slave ssh capability
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 9 Mar 2021 19:29:49 +0000 (14:29 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 9 Mar 2021 19:35:03 +0000 (14:35 -0500)
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 <jonathan.rajotte-julien@efficios.com>
lava/system-tests/authorized_keys [new file with mode: 0644]
lava/system-tests/setup.yaml [new file with mode: 0644]
scripts/system-tests/template_lava_job.jinja2

diff --git a/lava/system-tests/authorized_keys b/lava/system-tests/authorized_keys
new file mode 100644 (file)
index 0000000..2a53530
--- /dev/null
@@ -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 (file)
index 0000000..34c23c3
--- /dev/null
@@ -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
index ded42e93a8e89d21082d435a6025d29d993755c1..95ec1eb6f6908d8b5f60bacb10a4ddbd2611576d 100644 (file)
@@ -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
This page took 0.025714 seconds and 4 git commands to generate.