diff --git a/src/modules/rawfs/main.py b/src/modules/rawfs/main.py index d0f235372..1898d8fea 100644 --- a/src/modules/rawfs/main.py +++ b/src/modules/rawfs/main.py @@ -96,6 +96,8 @@ class RawFSItem: count = 0 libcalamares.utils.debug("Copying {} to {}".format(self.source, self.destination)) + if libcalamares.job.configuration["bogus"]: + return srcsize, srcblksize = get_device_size(self.source) destsize, destblksize = get_device_size(self.destination) diff --git a/src/modules/rawfs/rawfs.conf b/src/modules/rawfs/rawfs.conf index 10e654a7d..8d7da3ba3 100644 --- a/src/modules/rawfs/rawfs.conf +++ b/src/modules/rawfs/rawfs.conf @@ -22,3 +22,8 @@ targets: resize: true - mountPoint: /data source: /dev/mmcblk0p3 + +# To support testing, set the *bogus* key to true. No actual work is done, but the +# module's logic is exercised. + +# bogus: false diff --git a/src/modules/rawfs/tests/1.global b/src/modules/rawfs/tests/1.global new file mode 100644 index 000000000..c09df9375 --- /dev/null +++ b/src/modules/rawfs/tests/1.global @@ -0,0 +1,9 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ +partitions: + - mountPoint: / + device: /dev/sda1 + fs: ext4 + - mountPoint: /home + device: /dev/sda2 + fs: ext4 diff --git a/src/modules/rawfs/tests/1.job b/src/modules/rawfs/tests/1.job new file mode 100644 index 000000000..6079c43ed --- /dev/null +++ b/src/modules/rawfs/tests/1.job @@ -0,0 +1,14 @@ +# Testing configuration for rawfs + +--- + +targets: + - mountPoint: / + source: / + - mountPoint: /home + source: /images/home.img + resize: true + - mountPoint: /data + source: /dev/mmcblk0p3 + +bogus: true