]> git.proxmox.com Git - pve-common.git/blobdiff - test/etc_network_interfaces/runtest.pl
Inotify : write network config : use modern syntax for options
[pve-common.git] / test / etc_network_interfaces / runtest.pl
index ba26dcdab3c7a2fee8feaec67eb7b8281c02a1e2..c067dd1b38f3c498f437b850b9f33f204513a397 100755 (executable)
@@ -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;
 }