Ubuntu Pastebin

Paste from shadeslayer at Sun, 22 Nov 2015 13:52:33 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/test/test_ci_containment.rb b/test/test_ci_containment.rb
index 400766b..b394fdd 100644
--- a/test/test_ci_containment.rb
+++ b/test/test_ci_containment.rb
@@ -222,6 +222,19 @@ module CI
       end
     end
 
+    def test_chown_handler
+      Dir.chdir(@tmpdir) do
+        VCR.use_cassette(__method__) do
+          FileUtils.cp_r(Dir.glob("#{data}/*"), Dir.pwd)
+          c = Containment.new(@job_name, image: @image)
+          cmd = %w(usermod -u 5000 jenkins && groupmod -g 5000 jenkins)
+          c.run(Cmd: cmd)
+          assert_equal(5000, File.stat('my_file').uid)
+          assert_equal(5000, File.stat('my_file').gid)
+        end
+      end
+    end
+
     def test_ZZZ_binds # Last test always! Changes VCR configuration.
       # Container binds were overwritten by Containment at some point, make
       # sure the binds we put in are the binds that are passed to docker.
Download as text