Skip to content

tc_common.py: fix generic register dump doc #138

tc_common.py: fix generic register dump doc

tc_common.py: fix generic register dump doc #138

Workflow file for this run

name: tbottest selftest CI
on:
push:
branches:
- master
- testing-ci
pull_request:
jobs:
test:
name: Testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies, doc-tools
run: |
python -m pip install --upgrade pip
pip3 install --user pytest mypy paramiko termcolor2 pyserial coverage pytest-cov
- name: Configure SSH
env:
SSH_KEY: ${{ secrets.PRIVATE_KEY }}
SSH_HOST: ${{ secrets.TARGET_HOST }}
SSH_USER: ${{ secrets.TARGET_USER }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/staging.key
echo "SSHUSER: $SSH_USER"
chmod 600 ~/.ssh/staging.key
cat >>~/.ssh/config <<END
Host $SSH_HOST
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/staging.key
StrictHostKeyChecking no
Host 192.168.1.113
HostName 192.168.1.113
User $SSH_USER
ProxyJump $SSH_HOST
IdentityFile ~/.ssh/staging.key
StrictHostKeyChecking no
END
- name: Run tbottest selftests
run: |
export COLUMNS=160
# for unknown reasons termcolor2 get not found
# but Install step shows, that it is installed
export PYTHONPATH=/home/runner/.local/lib/python3.7/site-packages
mkdir temp
cd temp
# set some git default values so git am works
git config --global user.email "[email protected]"
git config --global user.name "Heiko Schocher"
../scripts/create_setup.sh
# test if ssh works
echo "--------------------- try forwarder ------------------"
ssh -o StrictHostKeyChecking=no -i ~/.ssh/staging.key [email protected] /home/pi/hello.sh
echo "---------------------- try to login on lab -----------"
ssh -o StrictHostKeyChecking=no -i '~/.ssh/staging.key' [email protected] /home/pi/hello.sh
# correct path to keyfile
sed -i "s|/home/\${username}/.ssh/id_rsa|~/.ssh/staging.key|g" tbotconfig/foo/tbot.ini
echo "----- Test commandline completion ------------------------------------"
set +e
returncode=0
RET=$(tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth --complete-module tbotco)
if [[ "${RET}" != "tbotconfig" ]];then
echo "Commandline completion module failed"
returncode=1
fi
RET=$(tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth --complete-module tbotconfig.in)
if [[ "${RET}" != "tbotconfig.interactive" ]];then
echo "Commandline completion module second level failed"
returncode=1
fi
RET=$(tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth --complete-testcase tbotconfig.interactive.la)
if [[ "${RET}" != "tbotconfig.interactive.lab" ]];then
echo "Commandline completion testcase failed"
returncode=1
fi
echo "----- now try to login into lab with tbot setup and do all tests -----"
tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth -q -q tbotconfig.ci.tests.all
exitcode="$?"
if [[ "${exitcode}" != "0" ]];then
echo "doing all tests failed"
returncode=1
fi
# and test second build host
tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth -q -q tbotconfig.ci.testbh.bhall
if [[ "${exitcode}" != "0" ]];then
echo "doing all build host tests failed"
returncode=1
fi
tbottest/newtbot_starter.py @tbotconfig/foo/args/argsfoo-noeth -f buildername:sisyphus -q -q tbotconfig.ci.testbh.bhall
if [[ "${exitcode}" != "0" ]];then
echo "doing all sisyphus build host tests failed"
returncode=1
fi
# now check board locking
cp ../scripts/ci/check_lab_locking.sh .
./check_lab_locking.sh
exitcode="$?"
if [[ "${exitcode}" != "0" ]];then
echo "checking lab locking mechanism failed"
returncode=1
fi
exit "${returncode}"