[elbe-devel] [PATCH v2 5/9] tests efilesystem: Test for multiple symlinks for copy_filelist

Olivier Dion dion at linutronix.de
Mon May 4 20:00:08 CEST 2020


This test for cases when multiple symlinks are found in a path.  For
example, we might have /usr/local/bin -> /bin and /bin -> /usr/bin

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/tests/test_efilesystem.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/elbepack/tests/test_efilesystem.py b/elbepack/tests/test_efilesystem.py
index 54b014fc..2a6427d2 100644
--- a/elbepack/tests/test_efilesystem.py
+++ b/elbepack/tests/test_efilesystem.py
@@ -60,3 +60,21 @@ class TestCopyFilelist(unittest.TestCase):
         # /DST/a/b/c/bla
         self.assertEqual(self.src.read_file('/a/b/c//bla'),
                          self.dst.read_file('/a/b/c/bla'))
+
+    def test_multilinks(self):
+
+        self.src.mkdir_p('/a')
+
+        # a <- b
+        # ../b <- /a/c
+        self.src.symlink('a', '/b')
+        self.src.symlink('../b', '/a/c')
+
+        # This write into /a/bla
+        self.src.write_file('a/c/bla', 0o644, 'bla')
+
+        copy_filelist(self.src, ['/a/c/bla'], self.dst)
+
+        # We should now have the content from /SRC/a/bla in /DST/a/bla
+        self.assertEqual(self.src.read_file('/a/bla'),
+                         self.dst.read_file('/a/bla'))
-- 
2.26.2




More information about the elbe-devel mailing list