mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-18 20:57:56 +00:00
Ensure tests with packet filtering are using the dummy network interface
This commit is contained in:
parent
f0ce85bd8d
commit
2e4835d7d6
@ -489,6 +489,8 @@ overlay_interface_init(const char *name, struct socket_address *addr,
|
||||
interface->alarm.stats=&interface_poll_stats;
|
||||
|
||||
if (ifconfig->socket_type == SOCK_DGRAM){
|
||||
if (ifconfig->drop_broadcasts || ifconfig->drop_unicasts || ifconfig->drop_packets)
|
||||
FATALF("Invalid interface definition. We only support dropping packets on dummy file interfaces");
|
||||
interface->local_echo = 1;
|
||||
|
||||
if (overlay_interface_init_socket(interface))
|
||||
|
@ -34,9 +34,7 @@ teardown() {
|
||||
report_all_servald_servers
|
||||
}
|
||||
|
||||
# Called by start_servald_instances for each instance.
|
||||
configure_servald_server() {
|
||||
add_servald_interface
|
||||
default_config() {
|
||||
executeOk_servald config \
|
||||
set log.console.level debug \
|
||||
set log.console.show_pid on \
|
||||
@ -52,6 +50,12 @@ configure_servald_server() {
|
||||
set mdp.iftype.wifi.tick_ms 500
|
||||
}
|
||||
|
||||
# Called by start_servald_instances for each instance.
|
||||
configure_servald_server() {
|
||||
add_servald_interface
|
||||
default_config
|
||||
}
|
||||
|
||||
setup_common() {
|
||||
setup_servald
|
||||
assert_no_servald_processes
|
||||
@ -194,15 +198,18 @@ test_MDPTransportFailOver() {
|
||||
|
||||
doc_UnicastTransfer="Rhizome over unicast MDP link"
|
||||
setup_UnicastTransfer() {
|
||||
configure_servald_server() {
|
||||
default_config
|
||||
executeOk_servald config \
|
||||
set rhizome.http.enable 0
|
||||
}
|
||||
setup_common
|
||||
foreach_instance +A +B \
|
||||
executeOk_servald config \
|
||||
set rhizome.http.enable 0
|
||||
set_instance +A
|
||||
add_servald_interface --file
|
||||
rhizome_add_file file1 2048
|
||||
set_instance +B
|
||||
add_servald_interface --file
|
||||
executeOk_servald config \
|
||||
set interfaces.1.file foo \
|
||||
set interfaces.1.drop_broadcasts on
|
||||
start_servald_instances +A +B
|
||||
foreach_instance +A assert_peers_are_instances +B
|
||||
@ -297,12 +304,14 @@ test_FileTransferBigMDP() {
|
||||
|
||||
doc_FileTransferUnreliableBigMDP="Big new bundle over unreliable MDP transport"
|
||||
setup_FileTransferUnreliableBigMDP() {
|
||||
configure_servald_server() {
|
||||
add_servald_interface --file
|
||||
default_config
|
||||
executeOk_servald config \
|
||||
set rhizome.http.enable 0 \
|
||||
set interfaces.1.drop_packets 10
|
||||
}
|
||||
setup_common
|
||||
foreach_instance +A +B \
|
||||
executeOk_servald config \
|
||||
set rhizome.http.enable 0 \
|
||||
set interfaces.1.file dummy \
|
||||
set interfaces.1.drop_packets 10
|
||||
setup_bigfile_common
|
||||
}
|
||||
test_FileTransferUnreliableBigMDP() {
|
||||
|
Loading…
Reference in New Issue
Block a user