Quellcode durchsuchen

src/t: Fix dpkg-divert.t to work even w/o /dev/full

The /dev/full device is not usually available outside of Linux, and we
should not rely on it.
Guillem Jover vor 11 Jahren
Ursprung
Commit
1d01c619ff
2 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  1. 1 0
      debian/changelog
  2. 8 2
      src/t/dpkg_divert.t

+ 1 - 0
debian/changelog

@@ -71,6 +71,7 @@ dpkg (1.18.0) UNRELEASED; urgency=low
     - Check perl code compilation, warnings and strictness.
     - Fix dpkg-divert unit test to work on BSD «rm -rf» that cannot traverse
       directories with mode 000.
+    - Fix dpkg-divert unit test to work when there is no /dev/full.
   * Build system:
     - Bump gettext version to 0.19:
       + Use --add-location=file in msgmerge and xgettext commands.

+ 8 - 2
src/t/dpkg_divert.t

@@ -619,8 +619,14 @@ SKIP: {
 
     system("chmod 500 $admindir");
     call_divert(["$testdir/foo"], expect_failure => 1, expect_stderr_like => qr/create.*new/);
-    system("chmod 755 $admindir; ln -s /dev/full $admindir/diversions-new");
-    call_divert(["$testdir/foo"], expect_failure => 1, expect_stderr_like => qr/(write|flush|close).*new/);
+
+    SKIP: {
+        skip 'device /dev/full is not available', 2 if not -c '/dev/full';
+
+        system("chmod 755 $admindir; ln -s /dev/full $admindir/diversions-new");
+        call_divert(["$testdir/foo"], expect_failure => 1,
+                    expect_stderr_like => qr/(write|flush|close).*new/);
+    }
 }
 
 system("rm -f $admindir/diversions-new; mkdir $admindir/diversions-old");