소스 검색

dpkg-divert: fix the test-suite to also skip tests that would fail if run as root

Raphaël Hertzog 15 년 전
부모
커밋
7e17d3bfc4
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      debian/changelog
  2. 3 3
      src/t/100_dpkg_divert.t

+ 2 - 0
debian/changelog

@@ -83,6 +83,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
   * Add some common makefile snippets for use in rules files in
     /usr/share/dpkg/: default.mk, architecture.mk, buildflags.mk, vendor.mk
     Closes: #606839
+  * Fix the dpkg-divert test-suite to also skip test that would fail if run
+    under root. Closes: #634961
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 3 - 3
src/t/100_dpkg_divert.t

@@ -485,7 +485,7 @@ cleanup();
 note("Corrupted divertions db handling");
 
 SKIP: {
-    skip "running under fakeroot", 3, if (defined($ENV{FAKEROOTKEY}));
+    skip "running as root or similar", 3, if (defined($ENV{FAKEROOTKEY}) or $> == 0);
 
     # An inexistent diversions db file should not be considered a failure,
     # but a failure to open it should be.
@@ -514,7 +514,7 @@ call_divert_sort(['--list'], expect_failure => 1,
 cleanup();
 
 SKIP: {
-    skip "running under fakeroot", 10, if (defined($ENV{FAKEROOTKEY}));
+    skip "running as root or similar", 10, if (defined($ENV{FAKEROOTKEY}) or $> == 0);
 
     note("R/O directory");
 
@@ -548,7 +548,7 @@ note("Errors during saving diversions db");
 install_diversions('');
 
 SKIP: {
-    skip "running under fakeroot", 4, if (defined($ENV{FAKEROOTKEY}));
+    skip "running as root or similar", 4, if (defined($ENV{FAKEROOTKEY}) or $> == 0);
 
     system("chmod 500 $admindir");
     call_divert(["$testdir/foo"], expect_failure => 1, expect_stderr_like => qr/create.*new/);