Skip to content

Commit

Permalink
tests: storage: add storage write test for bmap images
Browse files Browse the repository at this point in the history
Signed-off-by: Cedric Hombourger <[email protected]>
  • Loading branch information
chombourger committed Aug 14, 2023
1 parent 01d7ef9 commit f6850f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: actions/checkout@v3
- name: tox
run: |
sudo apt-get install -y bmap-tools
pip3 install --user tox
tox -s
mtda-nanopi-images:
Expand Down
4 changes: 3 additions & 1 deletion scripts/test-using-docker
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ cd ${tmp_dir}

echo "# getting various docker images"
docker stop mtda-docker >/dev/null 2>&1 || true
for image in alpine debian ubuntu archlinux almalinux
for image in alpine debian ubuntu archlinux almalinux rockylinux:9
do
docker pull ${image} >/dev/null || exit ${?}
docker rm mtda-docker >/dev/null 2>&1 || true
docker create --name=mtda-docker ${image} sh >/dev/null
image=$(echo ${image} || cut -d: -f1)
docker export mtda-docker > ${image}.tar || exit ${?}
done

Expand All @@ -67,6 +68,7 @@ gzip -f debian.tar || exit ${?}
zstd --rm -f ubuntu.tar || exit ${?}
bzip2 -f archlinux.tar || exit ${?}
xz -f almalinux.tar || exit ${?}
bmaptool create rockylinux.tar > rockylinux.tar.bmap || exit ${?}
du -sh *.tar*

echo "# starting mtda in the background"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ def test_write_raw(powered_off):
assert Console.wait_for("Alpine") is not None


def test_write_bmap(powered_off):
assert Storage.to_host() is True
Storage.write("rockylinux.tar")
assert Storage.to_target() is True

assert Target.on() is True
Console.send("cat /etc/os-release\r")
assert Console.wait_for("Rocky Linux") is not None


def test_write_bz2(powered_off):
assert Storage.to_host() is True
Storage.write("archlinux.tar.bz2")
Expand Down

0 comments on commit f6850f1

Please sign in to comment.