diff --git a/asu/build.py b/asu/build.py index 3c80ebd0..6fdd0448 100644 --- a/asu/build.py +++ b/asu/build.py @@ -271,7 +271,7 @@ def download_file(filename: str, dest: str = None): log.debug("Created store path: %s", req["store_path"] / bin_dir) - if "filesystem" in req: + if req.get("filesystem"): config_path = cache_workdir / ".config" config = config_path.read_text() @@ -293,6 +293,7 @@ def download_file(filename: str, dest: str = None): config_path.write_text(config) else: + log.debug("Enable default filesystems") copyfile( cache_workdir / ".config.orig", cache_workdir / ".config", diff --git a/asu/openapi.yml b/asu/openapi.yml index 283a5be3..2d8af63f 100644 --- a/asu/openapi.yml +++ b/asu/openapi.yml @@ -260,6 +260,7 @@ components: - ext4 - ubifs - jffs2 + - "" description: | Ability to specify filesystem running on device. Attaching this optional parameter will limit the ImageBuilder to only build diff --git a/tests/test_api.py b/tests/test_api.py index c236bf57..57ed2ee0 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -62,6 +62,26 @@ def test_api_build_filesystem_squashfs(app, upstream): assert "# CONFIG_TARGET_ROOTFS_EXT4FS is not set" in config assert "CONFIG_TARGET_ROOTFS_SQUASHFS=y" in config +def test_api_build_filesystem_empty(app, upstream): + client = app.test_client() + response = client.post( + "/api/v1/build", + json=dict( + version="TESTVERSION", + target="testtarget/testsubtarget", + profile="testprofile", + packages=["test1", "test2"], + filesystem="", + ), + ) + assert response.status == "200 OK" + assert response.json.get("request_hash") == "33377fbd91c50c4236343f1dfd67f9ae" + config = ( + app.config["CACHE_PATH"] / "cache/TESTVERSION/testtarget/testsubtarget/.config" + ).read_text() + assert "CONFIG_TARGET_ROOTFS_EXT4FS=y" in config + assert "CONFIG_TARGET_ROOTFS_SQUASHFS=y" in config + def test_api_build_filesystem_reset(app, upstream): client = app.test_client()