Przeglądaj źródła

do not show IP in output of testcases

On travis-ci connect.cc detects a rotation, triggering it store the IP
which is later appended to the error message, which is all nice and
great if we deal with a real server, but in the testcases it just
triggers failures as strings do not match.

Git-Dch: Ignore
David Kalnischkies 11 lat temu
rodzic
commit
0045df3fc7
2 zmienionych plików z 7 dodań i 1 usunięć
  1. 4 1
      apt-pkg/acquire-method.cc
  2. 3 0
      test/integration/framework

+ 4 - 1
apt-pkg/acquire-method.cc

@@ -102,7 +102,10 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
    if (Queue != 0)
    {
       std::cout << "400 URI Failure\nURI: " << Queue->Uri << "\n"
-		<< "Message: " << Err << " " << IP << "\n";
+		<< "Message: " << Err;
+      if (IP.empty() == false && _config->FindB("Acquire::Failure::ShowIP", true) == true)
+	 std::cout << " " << IP;
+      std::cout << "\n";
       Dequeue();
    }
    else

+ 3 - 0
test/integration/framework

@@ -235,6 +235,9 @@ setupenvironment() {
 	echo 'quiet::NoStatistic "true";' >> aptconfig.conf
 	# too distracting for users, but helpful to detect changes
 	echo 'Acquire::Progress::Ignore::ShowErrorText "true";' >> aptconfig.conf
+	# in testcases, it can appear as if localhost has a rotation setup,
+	# hide this as we can't really deal with it properly
+	echo 'Acquire::Failure::ShowIP "false";' >> aptconfig.conf
 
 	echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
 	echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary