X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=test%2Fetc_network_interfaces%2Fruntest.pl;h=c067dd1b38f3c498f437b850b9f33f204513a397;hp=ba26dcdab3c7a2fee8feaec67eb7b8281c02a1e2;hb=885641fb6a52ce2095180d912070af378026d631;hpb=936218b86f0a370dc78a378b7f87cfc5b4efc450 diff --git a/test/etc_network_interfaces/runtest.pl b/test/etc_network_interfaces/runtest.pl index ba26dcd..c067dd1 100755 --- a/test/etc_network_interfaces/runtest.pl +++ b/test/etc_network_interfaces/runtest.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl use lib '../../src'; +use lib '.'; use strict; use warnings; @@ -59,16 +60,15 @@ sub flush_files() { ## Interface parsing: ## -# Read an interfaces file with optional /proc/net/dev and /proc/net/if_inet6 -# file content strings, which default to the provided ones. +# Read an interfaces file with optional /proc/net/dev file content string and +# the list of active interfaces, which otherwise default sub r($;$$) { - my ($ifaces, $proc_net_dev, $proc_net_if_inet6) = @_; + my ($ifaces, $proc_net_dev, $active) = @_; $proc_net_dev //= load('proc_net_dev'); - $proc_net_if_inet6 //= load('proc_net_if_inet6'); + $active //= [split(/\s+/, load('active_interfaces'))]; open my $fh1, '<', \$ifaces; open my $fh2, '<', \$proc_net_dev; - open my $fh3, '<', \$proc_net_if_inet6; - $config = PVE::INotify::__read_etc_network_interfaces($fh1, $fh2, $fh3); + $config = PVE::INotify::__read_etc_network_interfaces($fh1, $fh2, $active); close $fh1; }