generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 4
/
test-module.sh
executable file
·38 lines (31 loc) · 971 Bytes
/
test-module.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#
LEADER_NODE=$1
IMAGE_URL=$2
SSH_KEYFILE=${SSH_KEYFILE:-$HOME/.ssh/id_rsa}
ssh_key="$(cat $SSH_KEYFILE)"
podman run -i \
-v .:/home/pwuser/ns8-module:z \
--volume=site-packages:/home/pwuser/.local/lib/python3.8/site-packages:Z \
--name rf-core-runner ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:v10.0.3 \
bash -l -s <<EOF
set -e
echo "$ssh_key" > /home/pwuser/ns8-key
set -x
pip install -r /home/pwuser/ns8-module/tests/pythonreq.txt
mkdir ~/outputs
cd /home/pwuser/ns8-module
robot -v NODE_ADDR:${LEADER_NODE} \
--console dotted \
-v IMAGE_URL:${IMAGE_URL} \
-v SSH_KEYFILE:/home/pwuser/ns8-key \
-d ~/outputs /home/pwuser/ns8-module/tests/
EOF
tests_res=$?
podman cp rf-core-runner:/home/pwuser/outputs tests/
podman stop rf-core-runner
podman rm rf-core-runner
exit ${tests_res}