diff --git a/.github/scripts/check-coverage.sh b/.github/scripts/check-coverage.sh index 47caa81..cc4956e 100755 --- a/.github/scripts/check-coverage.sh +++ b/.github/scripts/check-coverage.sh @@ -2,7 +2,7 @@ make coverage -target=70.0 +target=74.0 p=$(lcov --summary coverage.info | grep "lines" | grep -Eo "[0-9]+\.[0-9]+") if (( $(echo "$p < $target" | bc -l) )); then echo "Error: Coverage $p% is less than $target%" diff --git a/Makefile b/Makefile index 91a5f0e..1429055 100644 --- a/Makefile +++ b/Makefile @@ -63,10 +63,12 @@ $(BIN_DIR)/test_disk.raw: $(BIN_DIR)/test_image.raw truncate --size 100M $@ check: - sudo ./build/bin/test_ubi --cpumask [0,1,2] --json test/test_conf.json $(TEST_BDEVS) + sudo ./build/bin/test_ubi --cpumask [0,1,2] --json test/test_conf.json \ + --json-ignore-init-errors $(TEST_BDEVS) valgrind: - sudo valgrind ./build/bin/memcheck_ubi --cpumask [0] --json test/test_conf.json $(TEST_BDEVS) + sudo valgrind ./build/bin/memcheck_ubi --cpumask [0] \ + --json-ignore-init-errors --json test/test_conf.json $(TEST_BDEVS) coverage: lcov --capture --directory . --exclude=`pwd`/test/'*.c' --no-external --output-file coverage.info > /dev/null diff --git a/test/test_conf.json b/test/test_conf.json index 3ed1449..fd644c7 100644 --- a/test/test_conf.json +++ b/test/test_conf.json @@ -3,6 +3,12 @@ { "subsystem": "bdev", "config": [ + { + "method": "bdev_ubi_create", + "params": { + "name": "ubi_with_missing_args" + } + }, { "method": "bdev_malloc_create", "params": { @@ -11,6 +17,36 @@ "num_blocks": 204800 } }, + { + "method": "bdev_ubi_create", + "params": { + "name": "ubi_to_be_deleted", + "base_bdev": "malloc0", + "image_path": "build/bin/test_image.raw", + "stripe_size_kb": 1024, + "copy_on_read": false, + "directio": false, + "no_sync": false + } + }, + { + "method": "bdev_ubi_delete", + "params": { + "name": "invalid bdev name" + } + }, + { + "method": "bdev_ubi_delete", + "params": { + "invalid_param": 1 + } + }, + { + "method": "bdev_ubi_delete", + "params": { + "name": "ubi_to_be_deleted" + } + }, { "method": "bdev_ubi_create", "params": {