Bläddra i källkod

libdpkg: Mark the command_get_pager() tests on a tty as TODO

The build daemon environment does not expose a controlling terminal.
Mark these as possibly failing and as such non-fatal.
Guillem Jover 12 år sedan
förälder
incheckning
8cd7aa2c68
2 ändrade filer med 12 tillägg och 8 borttagningar
  1. 2 0
      debian/changelog
  2. 10 8
      lib/dpkg/test/t-command.c

+ 2 - 0
debian/changelog

@@ -16,6 +16,8 @@ dpkg (1.17.9) UNRELEASED; urgency=low
     Although this should not have security implications as the buffer is
     surrounded by two arrays (so those catch accesses even if the stack
     grows up or down), and we are compiling with -fstack-protector anyway.
+  * Mark the command_get_pager() tests on a tty as TODO for now, so that
+    we do not get failures on build daemons.
 
   [ Updated scripts translations ]
   * French (Steve Petruzzello). Closes: #746350

+ 10 - 8
lib/dpkg/test/t-command.c

@@ -225,14 +225,16 @@ test_command_pager(void)
 	int origfd = dup(STDOUT_FILENO);
 
 	/* Test stdout being a tty. */
-	test_dup_file(STDOUT_FILENO, "/dev/tty", O_WRONLY);
-	setenv("PAGER", "test-pager", 1);
-	pager = command_get_pager();
-	unsetenv("PAGER");
-	default_pager = command_get_pager();
-	dup2(origfd, STDOUT_FILENO);
-	test_str(pager, ==, "test-pager");
-	test_str(default_pager, ==, DEFAULTPAGER);
+	test_todo_block("environment might not expose controlling terminal") {
+		test_dup_file(STDOUT_FILENO, "/dev/tty", O_WRONLY);
+		setenv("PAGER", "test-pager", 1);
+		pager = command_get_pager();
+		unsetenv("PAGER");
+		default_pager = command_get_pager();
+		dup2(origfd, STDOUT_FILENO);
+		test_str(pager, ==, "test-pager");
+		test_str(default_pager, ==, DEFAULTPAGER);
+	}
 
 	/* Test stdout not being a tty. */
 	test_dup_file(STDOUT_FILENO, "/dev/null", O_WRONLY);