Commit 2ecc25ef authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: clean a test root before executing tests in userns

A tests is executed from different users in cases with and without
userns, so it can't to open files which were created before.

Here is an example for ns/user/static/inotify_irmap:
13355 mkdir("/etc", 0600)               = -1 EEXIST (File exists)
13355 unlink("/etc/zdtm-test")          = -1 EACCES (Permission denied)
13355 creat("/etc/zdtm-test", 0600)     = -1 EACCES (Permission denied)
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9b600167
...@@ -25,6 +25,7 @@ zdtm-tst-list: zdtm.sh ...@@ -25,6 +25,7 @@ zdtm-tst-list: zdtm.sh
zdtm: zdtm-tst-list .FORCE zdtm: zdtm-tst-list .FORCE
$(MAKE) -f Makefile.zdtm zdtm_nons $(MAKE) -f Makefile.zdtm zdtm_nons
$(MAKE) -f Makefile.zdtm zdtm_ns $(MAKE) -f Makefile.zdtm zdtm_ns
$(MAKE) clean_root
$(MAKE) -f Makefile.zdtm zdtm_ns_user $(MAKE) -f Makefile.zdtm zdtm_ns_user
zdtm-pre-dump: zdtm-tst-list zdtm-pre-dump: zdtm-tst-list
...@@ -44,13 +45,18 @@ fault-injection: .FORCE ...@@ -44,13 +45,18 @@ fault-injection: .FORCE
override CFLAGS += -D_GNU_SOURCE override CFLAGS += -D_GNU_SOURCE
clean: clean_root:
$(RM) zdtm_ct zdtm-tst-list
$(Q) $(RM) -r ./lib/ $(Q) $(RM) -r ./lib/
$(Q) $(RM) -r ./lib64/ $(Q) $(RM) -r ./lib64/
$(Q) $(RM) -r ./dump/
$(Q) $(RM) -r ./tmp $(Q) $(RM) -r ./tmp
$(Q) $(RM) -r ./etc
$(Q) $(RM) -r ./dev
$(Q) $(RM) -r ./bin
clean: clean_root
$(RM) zdtm_ct zdtm-tst-list
$(Q) $(RM) *.log $(Q) $(RM) *.log
$(Q) $(RM) -r ./dump/
$(Q) $(MAKE) -C zdtm cleandep clean cleanout $(Q) $(MAKE) -C zdtm cleandep clean cleanout
$(Q) $(MAKE) -C libcriu clean $(Q) $(MAKE) -C libcriu clean
$(Q) $(MAKE) -C rpc clean $(Q) $(MAKE) -C rpc clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment