Re-enable all the native tests

Some were wrongly disabled in 275eefa
This commit is contained in:
emanuele-f 2023-08-17 22:37:24 +02:00
parent 86b4c505e3
commit 85c2fda5db
6 changed files with 10 additions and 9 deletions

View File

@ -161,11 +161,10 @@ static int connectPcapd(pcapdroid_t *pd) {
log_d("BPF filter is in use");
}
#ifdef ANDROID
if(pd->pcap_file_capture) {
// must be a file path
if(access(pd->pcap.capture_interface, F_OK)) {
log_f("The specified PCAP file does not exist");
log_f("The specified PCAP file does not exist: %s", pd->pcap.capture_interface);
goto cleanup;
}
} else {
@ -175,7 +174,6 @@ static int connectPcapd(pcapdroid_t *pd) {
goto cleanup;
}
}
#endif
// Start the daemon
char args[256];

View File

@ -23,6 +23,8 @@
#include <stdint.h>
#include <net/if.h>
#include <pcap.h>
#include <linux/limits.h>
#include "nl_utils.h"
#include "common/uid_lru.h"
#include "common/uid_resolver.h"

View File

@ -1,5 +1,5 @@
project(tests)
cmake_minimum_required(VERSION 3.18.1)
project(tests)
option(FUZZING "Build for Fuzz Testing" OFF)

View File

@ -26,9 +26,9 @@ add_test(NAME blacklist_match COMMAND ./blacklist match)
add_test(NAME blacklist_detection COMMAND ./blacklist detection)
test_source(dump_api)
#~ add_test(NAME dump_api_snaplen COMMAND ./dump_api snaplen)
add_test(NAME dump_api_snaplen COMMAND ./dump_api snaplen)
add_test(NAME dump_api_max_pkts_flow COMMAND ./dump_api max_pkts_per_flow)
#~ add_test(NAME dump_api_max_size COMMAND ./dump_api max_dump_size)
add_test(NAME dump_api_max_size COMMAND ./dump_api max_dump_size)
#~ test_source(root_capture)
#~ add_test(NAME root_capture COMMAND ./root_capture invalid_pkts)
test_source(root_capture)
add_test(NAME root_capture COMMAND ./root_capture invalid_pkts)

View File

@ -91,7 +91,7 @@ static void max_pkts_per_flow() {
src_ip = pkt.tuple.src_ip;
dst_ip = pkt.tuple.dst_ip;
remote_ip = (zdtun_cmp_ip(4, &pkt.tuple.src_ip, &local_ip) == 0) ?
remote_ip = (zdtun_cmp_ip(4, &src_ip, &local_ip) == 0) ?
&dst_ip : &src_ip;
#if 0

View File

@ -86,6 +86,7 @@ pcapdroid_t* pd_init_test(const char *ifname) {
assert(pd != NULL);
pd->vpn_capture = false;
pd->pcap_file_capture = true;
pd->pcap.capture_interface = (char*) ifname;
pd->pcap.as_root = false; // don't run as root
pd->app_filter = -1; // don't filter