mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Add integration tests
Tests if repository json files conform to the json schema. If all resources (images/icons/website URLs) they mention actually exists. And can also test writing images and the FAT modification code.
This commit is contained in:
parent
fce80b2a67
commit
05f1c4dbb5
11 changed files with 319 additions and 8 deletions
30
tests/README.md
Normal file
30
tests/README.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
Integration tests
|
||||
===
|
||||
|
||||
Test if all json files in the public repository are correct (validate against json schema, and test all image files, icons and websites mentioned in the json do exist by performing HEAD requests)
|
||||
|
||||
```
|
||||
$ cd tests
|
||||
$ pytest
|
||||
|
||||
```
|
||||
|
||||
Test if a specific json file validates correctly
|
||||
|
||||
```
|
||||
$ cd tests
|
||||
$ pytest --repo=http://my-repo/os_list.json
|
||||
```
|
||||
|
||||
Test image writes for all images in a repository
|
||||
|
||||
```
|
||||
$ cd tests
|
||||
$ truncate -s 16G loopfile
|
||||
$ udisksctl loop-setup --file loopfile
|
||||
Mapped file loopfile as /dev/loop24
|
||||
$ sudo -g disk pytest test_write_images.py --repo=http://my-repo/os_list.json --device=/dev/loop24
|
||||
```
|
||||
|
||||
Note: make sure automatic mounting of removable media is disabled in your Linux distribution during write tests.
|
||||
You can also use real drives instead of loop files as device. But be very careful not to enter the wrong device. Writes are done for real, it is not a mock test...
|
Loading…
Add table
Add a link
Reference in a new issue