[PATCH v3 12/14] selftests/nolibc: prepare /tmp for tmpfs or ramfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



create a /tmp directory and mount tmpfs there, if tmpfs is not
mountable, use ramfs as tmpfs.

tmpfs will be used instead of procfs for some tests.

Reviewed-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Signed-off-by: Zhangjin Wu <falcon@xxxxxxxxxxx>
---
 tools/testing/selftests/nolibc/nolibc-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index b7ea95dad0fb..906b70ddec79 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1053,6 +1053,10 @@ int prepare(void)
 		}
 	}
 
+	/* try to mount /tmp if not mounted, if not mountable, use ramfs as tmpfs */
+	mkdir("/tmp", 0755);
+	mount("none", "/tmp", "tmpfs", 0, 0);
+
 	return 0;
 }
 
-- 
2.25.1




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux