aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSergei Shilovsky <sshilovsky@gmail.com>2022-06-23 17:08:57 +0300
committerSergei Shilovsky <sshilovsky@gmail.com>2022-06-23 17:22:17 +0300
commit6d58ee41e9e4d11b1269d923f7ad27e27567274d (patch)
tree37493a0672150df34a32b39f6458c2adc5052030 /tests
parent3a1d2a1e265c43971f78ed1845920539ed00fd35 (diff)
downloadbindfs-6d58ee41e9e4d11b1269d923f7ad27e27567274d.tar.gz
test --map-passwd-rev and --map-shadow-rev
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_bindfs.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 95467a3..5912844 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -415,6 +415,7 @@ Tempfile.open('passwdfile') do |passwd_file|
passwd_file.flush
group_file.write("#{nobody_group}:x:789")
group_file.flush
+
root_testenv("--map-passwd=#{Shellwords.escape(passwd_file.path)} --map-group=#{Shellwords.escape(group_file.path)}") do
touch('src/file1')
chown(123, 789, 'src/file1')
@@ -426,6 +427,18 @@ Tempfile.open('passwdfile') do |passwd_file|
assert { File.stat('src/file2').uid == 123 }
assert { File.stat('src/file2').gid == 789 }
end
+
+ root_testenv("--map-passwd-rev=#{Shellwords.escape(passwd_file.path)} --map-group-rev=#{Shellwords.escape(group_file.path)}") do
+ touch('src/file1')
+ chown(nobody_uid, nobody_gid, 'src/file1')
+ assert { File.stat('mnt/file1').uid == 123 }
+ assert { File.stat('mnt/file1').gid == 789 }
+
+ touch('src/file2')
+ chown(123, 789, 'mnt/file2')
+ assert { File.stat('src/file2').uid == nobody_uid }
+ assert { File.stat('src/file2').gid == nobody_gid }
+ end
end
end