File: Fix-test-failure.patch

package info (click to toggle)
openvas-scanner 23.23.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,260 kB
  • sloc: ansic: 41,150; xml: 6,251; pascal: 3,723; yacc: 1,250; sh: 590; makefile: 95; javascript: 12
file content (28 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Sophie Brun <sophie@kali.org>
Date: Mon, 21 Dec 2020 15:18:23 +0100
Subject: Fix test failure

Do not test if interface is not available (case of ipv6 only machine)

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976712
---
 misc/pcap_tests.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/misc/pcap_tests.c b/misc/pcap_tests.c
index fb9718b..74d461d 100644
--- a/misc/pcap_tests.c
+++ b/misc/pcap_tests.c
@@ -148,8 +148,10 @@ Ensure (pcap, routethrough_src_globalsource_set)
   interface = routethrough (&dst, &src);
   /* dependent on local environment */
   // assert_that ((interface = routethrough (&dst, &src)), is_not_null);
-  assert_that (interface, is_not_equal_to_string ("lo"));
-  assert_that ((src.s_addr != INADDR_ANY));
+  if (interface != NULL) {
+    assert_that (interface, is_not_equal_to_string ("lo"));
+    assert_that ((src.s_addr != INADDR_ANY));
+  }
   g_socket_use_real = true;
 }