Skip to content

Commit

Permalink
Test upgrade
Browse files Browse the repository at this point in the history
Add a scenario for testing upgrade between version
  • Loading branch information
montjoie committed May 5, 2023
1 parent bacc75a commit 743a5e8
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 2 deletions.
55 changes: 54 additions & 1 deletion .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: basic
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy rule:line-length
push:
pull_request:

Expand All @@ -27,3 +27,56 @@ jobs:
run: find -iname '*.yaml' | xargs yamllint
- name: verify yml files
run: find -iname '*.yml' | xargs yamllint
check-lava-upgrade:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install lavacli
run: sudo apt-get -y install lavacli
- run: ./lavalab-gen.py boards-ci-2022.01.yaml
- run: cat output/local/docker-compose.yml
- name: Verify DNS query in docker
run: sh .github/docker-resolv.sh
- name: Build lava-docker
run: cd output/local && docker-compose build
- name: Launch lava-docker
run: cd output/local && docker-compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs wait 1

- name: Run backup
run: ./backup.sh
- name: stop docker
run: cd output/local && docker-compose down

- name: Clean old install
run: rm -r output
- name: Copy backup
run: cp -v backup-latest/* lava-master/backup/
- name: Run lavalab-gen
run: ./lavalab-gen.py boards-ci-2023.01.yaml
- name: Build lava-docker
run: cd output/local && docker-compose build
- name: Launch lava-docker
run: cd output/local && docker-compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs wait 2
- name: Verify we still have logs
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs 1
- name: Verify we still have logs really
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs 1 > log1 && [[ -s log1 ]] || exit 1
- name: stop docker
run: cd output/local && docker-compose down

- name: restart lava-docker
run: cd output/local && docker-compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
29 changes: 29 additions & 0 deletions .github/workflows/wait-for-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

cd output/local

TIMEOUT=0

while [ $TIMEOUT -le 1200 ]
do
lavacli --uri http://admin:[email protected]:10080/RPC2 devices list > devices.list
if [ $? -eq 0 ];then
grep -q qemu devices.list
if [ $? -eq 0 ];then
lavacli --uri http://admin:[email protected]:10080/RPC2 devices list
# now wait for a job
lavacli --uri http://admin:[email protected]:10080/RPC2 jobs list > joblist
grep -q Running joblist
if [ $? -eq 0 ];then
exit 0
lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs --no-follow 1
else
cat joblist
fi
fi
fi
docker-compose logs --tail=50
sleep 10
TIMEOUT=$((TIMEOUT+10))
done
exit 1
29 changes: 29 additions & 0 deletions boards-ci-2022.01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
masters:
- name: masterci1
version: "2022.01"
host: local
healthcheck_url: http://healthcheck
users:
- name: admin
token: tokenforci
password: passwordforci
superuser: true
staff: true
tokens:
- username: admin
token: dfjdfkfkdjfkdsjfslforci
description: no description
slaves:
- name: lab-ci-0
version: "2022.01"
host: local
remote_master: masterci1
remote_user: admin
use_overlay_server: false
use_tftp: false
host_healthcheck: true

boards:
- name: qemu-01
type: qemu
29 changes: 29 additions & 0 deletions boards-ci-2023.01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
masters:
- name: masterci1
version: "2023.01"
host: local
healthcheck_url: http://healthcheck
users:
- name: admin
token: tokenforci
password: passwordforci
superuser: true
staff: true
tokens:
- username: admin
token: dfjdfkfkdjfkdsjfslforci
description: no description
slaves:
- name: lab-ci-0
version: "2023.01"
host: local
remote_master: masterci1
remote_user: admin
use_overlay_server: false
use_tftp: false
host_healthcheck: true

boards:
- name: qemu-01
type: qemu
2 changes: 1 addition & 1 deletion healthcheck/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bitnami/minideb:stretch
FROM bitnami/minideb:bullseye

RUN apt-get update && apt-get -y install git
RUN git clone https://github.com/BayLibre/lava-healthchecks-binary.git
Expand Down

0 comments on commit 743a5e8

Please sign in to comment.