diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2015-04-22 12:48:57 +0100 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2015-04-22 12:48:57 +0100 |
commit | 3b048d5bf0046ffbc5af9740e3d77beb9f393ef4 (patch) | |
tree | b239d6a71922375a987220bc348e742873df29a7 | |
parent | 40244ad3fe73f245d96582c78744a77886bde467 (diff) |
Added check for directory existence
When upper and lower mounts do not exist, the tests fail to execute.
This patch allows tests to run successfully. There is also a change in
name of mount type from 'overlayfs' to 'overlay'. With these changes
tests pass successfully. The --um doesn't work as it requires specific
mount binary to be present in a specific path.
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | README | 15 | ||||
-rw-r--r-- | mount_union.py | 5 | ||||
-rw-r--r-- | set_up.py | 2 |
4 files changed, 11 insertions, 21 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index bf65d37..0000000 --- a/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CPPFLAGS += -D_GNU_SOURCE -CFLAGS += -O2 -Wall - -all: fs-op open-file - -fs-op: fs-op.c -open-file: open-file.c - -clean: - $(RM) *~ fs-op open-file @@ -1,13 +1,8 @@ To run these tests: - (1) Run make + (1) Make sure you have root permissions - (2) Copy fs-op and open-file to /usr/local/bin/ - - (3) If testing unionmount, do: - - ./run - - If testing overlayfs, do: - - TEST_OVERLAYFS=1 ./run.sh + (2) Run + ./run --ov + ./run --no + ./run --um (might not work because of the incorrect path) diff --git a/mount_union.py b/mount_union.py index 4999daa..e5db16b 100644 --- a/mount_union.py +++ b/mount_union.py @@ -1,3 +1,4 @@ +import os from tool_box import * def mount_union(ctx): @@ -22,11 +23,13 @@ def mount_union(ctx): else: lower_mntroot = cfg.lower_mntroot() upper_mntroot = cfg.upper_mntroot() + if not os.path.exists(upper_mntroot): + os.makedirs(upper_mntroot) system("mount -t tmpfs upper_layer " + upper_mntroot) upperdir = upper_mntroot + "/upper" workdir = upper_mntroot + "/work" os.mkdir(upperdir) os.mkdir(workdir) - system("mount -t overlayfs overlayfs " + union_mntroot + + system("mount -t overlay overlayfs " + union_mntroot + " -olowerdir=" + lower_mntroot + ",upperdir=" + upperdir + ",workdir=" + workdir) ctx.note_upper_fs(upper_mntroot, testdir) @@ -48,6 +48,8 @@ def set_up(ctx): pass # Create a lower layer to union over + if not os.path.exists(lower_mntroot): + os.makedirs(lower_mntroot) system("mount -t tmpfs lower_layer " + lower_mntroot) # Systemd has weird ideas about things |