-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demo: use fakeroot to avoid needing sudo
==================== Test output for //:mount_tmpfs_without_fakeroot: ++ mkdir -p /tmp/target ++ mount -t tmpfs none /tmp/target mount: /tmp/target: must be superuser to use mount. ==================== Test output for //:mount_tmpfs_fakeroot: ++ mkdir -p /tmp/target ++ mount -t tmpfs none /tmp/target ++ findmnt /tmp/target TARGET SOURCE FSTYPE OPTIONS /tmp/target none tmpfs rw,relatime,uid=1000,gid=1000,inode64
- Loading branch information
1 parent
8ce2e76
commit ffca16f
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
test --announce_rc | ||
common --lockfile_mode=off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
v = """ | ||
#!/bin/bash | ||
set -uxeo pipefail | ||
mkdir -p /tmp/target | ||
mount -t tmpfs none /tmp/target | ||
findmnt /tmp/target | ||
""" | ||
|
||
genrule( | ||
name = "test_sh", | ||
outs = ["test.sh"], | ||
cmd = "touch $@", | ||
name = "create_script", | ||
srcs = [], | ||
outs = ["mount_tmpfs.sh"], | ||
cmd = "echo \"{}\" > $@".format(v), | ||
executable = True, | ||
) | ||
|
||
sh_test( | ||
name = "mount_tmpfs_fakeroot", | ||
srcs = ["mount_tmpfs.sh"], | ||
tags = ["requires-fakeroot"], | ||
) | ||
|
||
sh_test( | ||
name = "test", | ||
srcs = ["test.sh"], | ||
name = "mount_tmpfs_without_fakeroot", | ||
srcs = ["mount_tmpfs.sh"], | ||
) |