A lot of CI code is python mixed with bash, e.g.,
ssh = getConnection(host)
ssh.run('ls')
ssh.run('echo')
At least some of this CI code would benefit if it was written in a
simple bash script, returning error codes and potentially other
information either through stdout/stderr or files, to the calling Python
code:
ssh = runScript(host, script)
# script does: ls; echo
This commit introduces the possibility to run entire scripts. The idea
is that the executor has a script (on localhost), which is either
executed locally or on a remote host. For the remote host, the script is
not copied but piped into a remotely executed bash. In both cases,
output is either returned like the Cmd.run() function with returncode
and mixed stdout/stderr, or optionally redirected into a file on the
(remote) host, which can be treated further by the Python code in later
steps.
In this directory and subdirectories are various CI code test cases and helper scripts.
Unit test
There are some unit tests. From the parent directory, i.e., ci-scripts/,
start with
python tests/deployment.py -v
python tests/ping-iperf.py -v
python tests/iperf-analysis.py -v
It will indicate if all tests passed. It assumes that these images are present:
oai-ci/oai-nr-ue:develop-12345678oai-ci/oai-gnb:develop-12345678
test-runner test
This is not a true test, because the results need to be manually inspected. To run this "test", run
./run.sh
inside the test-runner/ directory (important!).