[Pkg-utopia-maintainers] Bug#690987: Debdiff with new script to handle /etc/network/interfaces

Maximiliano Curia maxy at debian.org
Wed Nov 28 23:46:19 UTC 2012


Control: tag 606268 + patch
Control: tag 688355 + patch
Control: tag 690987 + patch

Hi,

The script that is used to comment out the interfaces in
/etc/network/interfaces was so buggy that I had to write it completly from
scratch to make it work properly.

I have added a number of tests, to verify that the script does what it is
supposed to do.  I added the cases listed in the reported bugs, and also other
cases taken from different computers I had access to.

The script comments out the whole block that refers to one iface, not just the
iface line.  In the case of mappings, it doesn't comment them out.  This could
be changed if it was decided that the desired behaviour was to also comment
them out, I didn't do it because the original script didn't even take them
into account.

I'm attaching the debdiff that modifies this script and adds the corresponding
tests (executed from debian/rules during the dh_auto_test step).

I would like to hear opinions about this script from the maintainers or other
interested parties.  In the case that I don't get any replies, I would do the
NMU in a couple of days.

-- 
"The cheapest, fastest and most reliable components of a computer system are
those that aren't there."
-- Gordon Bell
Saludos /\/\ /\ >< `/
-------------- next part --------------
diff -Nru network-manager-0.9.4.0/debian/changelog network-manager-0.9.4.0/debian/changelog
--- network-manager-0.9.4.0/debian/changelog	2012-09-11 19:24:44.000000000 +0200
+++ network-manager-0.9.4.0/debian/changelog	2012-11-28 22:04:03.000000000 +0100
@@ -1,3 +1,14 @@
+network-manager (0.9.4.0-6.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/ifblacklist_migrate.sh: Replace if blacklist script to manage more
+    complex cases of /etc/network/interfaces.
+    (Closes: #606268, #688355, #690987)
+  * debian/rules: Add test cases for if blacklist scripts.
+  * debian/tests/*: Test cases.
+
+ -- Maximiliano Curia <maxy at debian.org>  Wed, 28 Nov 2012 21:31:54 +0100
+
 network-manager (0.9.4.0-6) unstable; urgency=low
 
   * debian/rules: Use xz compression for binary packages.
diff -Nru network-manager-0.9.4.0/debian/ifblacklist_migrate.sh network-manager-0.9.4.0/debian/ifblacklist_migrate.sh
--- network-manager-0.9.4.0/debian/ifblacklist_migrate.sh	2012-09-11 19:24:44.000000000 +0200
+++ network-manager-0.9.4.0/debian/ifblacklist_migrate.sh	2012-11-28 21:29:35.000000000 +0100
@@ -1,66 +1,152 @@
 #!/bin/sh
 
-# (C) 2007 Canonical Ltd.
-# Author: Alexander Sack <asac at jwsdot.com>
+# (C) 2012 Debian
+# Author: Maximiliano Curia <maxy at debian.org>
 # License: GNU General Public License, version 2 or any later version
 
-if test x$NIF_FILE = x; then
+if [ -z "$NIF_FILE" ]; then
    NIF_FILE=/etc/network/interfaces
 fi
 
-auto_ifs=$(cat $NIF_FILE | \
-    egrep "^auto|^allow-" | \
-    sed -e 's/auto//' | \
-    sed -e 's/allow-[^ ].* //')
-
-ifaces_to_disable=""
-
-echo Auto interfaces found: $auto_ifs
-
-# iterate over all auto interfaces
-for i in $auto_ifs; do
-  IFS_old=$IFS; IFS=""
-
-  NIF_FILE_content=$(cat $NIF_FILE | \
-      sed -e 's/^[ \t]*auto.*$//' | \
-      sed -e 's/^[ \t]*allow-.*$//' | \
-      sed -e 's/^[ \t]*#.*$//' | grep -v ^$)
-
-  # '--' is inserted by grep -A1 if there are multiple iface blocks
-  lines=$(echo $NIF_FILE_content | grep -A1 "^iface.*$i.*dhcp" | grep -v '\--')
-  IFS="
-"
-
-  # if there is no iface line for that interface, we would still get a line
-  # count of 1 ... so use word_count 0 below to exclude ifaces that have no
-  # configuration at all.
-  word_count=$(echo $lines | wc -w)
-  line_count=0
-  for line in $lines; do
-      nulled_line=$(echo "$line" | sed -e 's/[# ]//' | grep -v ^iface)
-      if test x$nulled_line != x; then
-	  line_count=$(expr $line_count + 1)
-      fi
-  done
-
-  if test $line_count -eq 0 -a $word_count -gt 0; then
-     ifaces_to_disable="$ifaces_to_disable $i"
-     echo iface to disable = $i
-  fi
-  IFS=$IFS_old
+# Obtain the line numbers to comment
+lines_to_comment=$(awk '
+BEGIN {
+	# 0: NONE
+	# 1: iface
+	# 2: mapping
+	cur = 0;
+	buffer = "";
+	# line_ns will contain a key for each line in the buffer
+	# ifaces is an array with all the lines associated with each interface
+	name = "";
+	family = "";
+	method = "";
+}
+
+function lstrip(s)
+{
+	if (match(s, /^[[:space:]]+/)) {
+		return substr(s, RLENGTH + 1);
+	}
+	return s;
+}
+
+function rstrip(s)
+{
+	if (match(s, /[[:space:]]+$/)) {
+		return substr(s, 1, RSTART - 1);
+	}
+	return s;
+}
+
+function process(line, line_ns)
+{
+	words_len = split(line, words);
+	if (words[1] == "mapping") {
+		if (words_len < 2) { # invalid iface entry, skip it
+			cur = 0;
+			return;
+		}
+		cur = 2;
+		name = words[2];
+		mappings[name] = 1;
+	} else if (words[1] == "source") {
+		# Not supported by this script, only used to detect end of blocks
+		cur = 0;
+	} else if (words[1] == "iface") {
+		if (words_len < 4) { # invalid iface entry, skip it
+			cur = 0;
+			return;
+		}
+		cur = 1;
+		name = words[2];
+		family = words[3];
+		method = words[4];
+	} else if (words[1] == "auto") {
+		cur = 0;
+	} else if (words[1] ~ /^allow-/) {
+		cur = 0;
+	}
+	if (cur == 1) {
+		for (line_no in line_ns) {
+			ifaces[name, family, method, line_no] = 1;
+		}
+	}
+}
+
+# This block process each line in the file
+{
+	if (NF == 0) {
+	    # blank line
+	} else if ($1 ~ /^#/) {
+	    # comment
+	} else {
+	    line = lstrip($0);
+	    if (match(line, /\\$/)) {
+	    	# continued line
+			gsub(/\\$/, " ", line);
+	        buffer = buffer line;
+			# store the line number to be processed later
+			line_ns[FNR] = 1;
+	    } else {
+	    	# normal  line, add to buffer and process it
+	        buffer = rstrip(buffer line);
+			# store the line number to be processed later
+			line_ns[FNR] = 1;
+			# process the buffer
+			process(buffer, line_ns);
+			buffer = "";
+			delete line_ns;
+		}
+	}
+}
+
+END {
+	for (key in ifaces) {
+		split(key, a, SUBSEP);
+		name    = a[1];
+		family  = a[2];
+		method  = a[3];
+		line_no = a[4];
+		b_len = split(name, b, "-");
+		if ((b_len > 1) && (b[1] in mappings)) {
+			continue;
+		}
+		if ((family != "inet") && (family != "inet6")) {
+			continue;
+		}
+		if ((method != "dhcp") && (method != "auto")) {
+			continue;
+		}
+		print line_no;
+	}
+}
+' "$NIF_FILE")
+
+if [ -z "$lines_to_comment" ]; then
+	# nothing to do
+	exit 0
+fi
+
+sed_commands=''
+for line_no in $lines_to_comment; do
+	sed_commands="${sed_commands}${line_no}s/^/#NetworkManager#/;"
 done
 
+# Find the first unused .bak-# and backup
 backup_suffix=0
-while test -e ${NIF_FILE}.bak-${backup_suffix}; do
+while [ -e "${NIF_FILE}.bak-${backup_suffix}" ]; do
    backup_suffix=$(expr $backup_suffix + 1)
 done
 
-if [ -n "$ifaces_to_disable" ]; then
-    cp $NIF_FILE "$NIF_FILE.bak-${backup_suffix}"
-    for i in $ifaces_to_disable; do
-	echo -n "Disabling interface: $i ... "
-	sed -i -e "s/^\([ \t]*iface.*[ \t]$i[ \t].*\)$/#NetworkManager#\1/" $NIF_FILE
-	echo done.
-    done
-fi
+cp "$NIF_FILE" "$NIF_FILE.bak-${backup_suffix}"
 
+echo -n "Disabling dhcp and auto interfaces: "
+sed -i -e "$sed_commands" "$NIF_FILE"
+if [ $? -ne 0 ]; then
+	echo -n "failed. Reverting changes."
+	mv "$NIF_FILE.bak-${backup_suffix}" "$NIF_FILE"
+	echo " Please edit $NIF_FILE manually."
+else
+	echo "done."
+fi
diff -Nru network-manager-0.9.4.0/debian/rules network-manager-0.9.4.0/debian/rules
--- network-manager-0.9.4.0/debian/rules	2012-09-11 19:24:44.000000000 +0200
+++ network-manager-0.9.4.0/debian/rules	2012-11-28 21:46:03.000000000 +0100
@@ -3,6 +3,12 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+  RUN_TESTS := yes
+else
+  RUN_TESTS :=
+endif
+
 %:
 	dh $@
 
@@ -44,3 +50,13 @@
 	dh_builddeb -- -Zxz
 
 override_dh_auto_test:
+ifeq ($(RUN_TESTS),yes)
+	$(MAKE) -C debian/tests
+endif
+
+override_dh_auto_clean:
+	dh_auto_clean
+ifeq ($(RUN_TESTS),yes)
+	$(MAKE) -C debian/tests clean
+endif
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-000.in network-manager-0.9.4.0/debian/tests/if-000.in
--- network-manager-0.9.4.0/debian/tests/if-000.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-000.in	2012-11-28 21:51:05.000000000 +0100
@@ -0,0 +1,28 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+
+auto lo
+iface lo inet loopback
+name Loopback: Virtual interface
+
+#auto eth0
+##iface eth0 inet dhcp
+#iface eth0 inet static
+#    address 192.168.2.11
+#    netmask 255.255.255.0
+#    gateway 192.168.2.1
+#    dns-nameservers 192.168.2.1
+#    dns-search example.com
+#    dns-domain example.com
+#    post-up /sbin/ethtool -s $IFACE wol g
+#    post-down /sbin/ethtool -s $IFACE wol g
+#name Ethernet card
+#
+#allow-hotplug usb0
+#
+#iface usb0 inet static
+#    address 192.168.111.2
+#    netmask 255.255.255.0
+
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-000.out network-manager-0.9.4.0/debian/tests/if-000.out
--- network-manager-0.9.4.0/debian/tests/if-000.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-000.out	2012-11-28 21:51:09.000000000 +0100
@@ -0,0 +1,28 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+
+auto lo
+iface lo inet loopback
+name Loopback: Virtual interface
+
+#auto eth0
+##iface eth0 inet dhcp
+#iface eth0 inet static
+#    address 192.168.2.11
+#    netmask 255.255.255.0
+#    gateway 192.168.2.1
+#    dns-nameservers 192.168.2.1
+#    dns-search example.com
+#    dns-domain example.com
+#    post-up /sbin/ethtool -s $IFACE wol g
+#    post-down /sbin/ethtool -s $IFACE wol g
+#name Ethernet card
+#
+#allow-hotplug usb0
+#
+#iface usb0 inet static
+#    address 192.168.111.2
+#    netmask 255.255.255.0
+
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-001.in network-manager-0.9.4.0/debian/tests/if-001.in
--- network-manager-0.9.4.0/debian/tests/if-001.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-001.in	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,14 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+iface eth0 inet6 manual
+	up ip link set eth0 up
+	down ip link set eth0 down
diff -Nru network-manager-0.9.4.0/debian/tests/if-001.out network-manager-0.9.4.0/debian/tests/if-001.out
--- network-manager-0.9.4.0/debian/tests/if-001.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-001.out	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,14 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+#NetworkManager#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+iface eth0 inet6 manual
+	up ip link set eth0 up
+	down ip link set eth0 down
diff -Nru network-manager-0.9.4.0/debian/tests/if-002.in network-manager-0.9.4.0/debian/tests/if-002.in
--- network-manager-0.9.4.0/debian/tests/if-002.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-002.in	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,16 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+iface eth0 inet6 auto
+	# Activate RFC 4941 privacy extensions for outgoing connections. The
+	# machine will still be reachable via its EUI-64 interface identifier.
+	privext 2
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-002.out network-manager-0.9.4.0/debian/tests/if-002.out
--- network-manager-0.9.4.0/debian/tests/if-002.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-002.out	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,16 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+#NetworkManager#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+#NetworkManager#iface eth0 inet6 auto
+	# Activate RFC 4941 privacy extensions for outgoing connections. The
+	# machine will still be reachable via its EUI-64 interface identifier.
+#NetworkManager#	privext 2
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-003.in network-manager-0.9.4.0/debian/tests/if-003.in
--- network-manager-0.9.4.0/debian/tests/if-003.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-003.in	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,6 @@
+# The primary network interface
+allow-hotplug wlan0
+iface wlan0 inet dhcp
+        # wireless-* options are implemented by the wireless-tools package
+        wireless-mode managed
+	wireless-essid any
diff -Nru network-manager-0.9.4.0/debian/tests/if-003.out network-manager-0.9.4.0/debian/tests/if-003.out
--- network-manager-0.9.4.0/debian/tests/if-003.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-003.out	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,6 @@
+# The primary network interface
+allow-hotplug wlan0
+#NetworkManager#iface wlan0 inet dhcp
+        # wireless-* options are implemented by the wireless-tools package
+#NetworkManager#        wireless-mode managed
+#NetworkManager#	wireless-essid any
diff -Nru network-manager-0.9.4.0/debian/tests/if-004.in network-manager-0.9.4.0/debian/tests/if-004.in
--- network-manager-0.9.4.0/debian/tests/if-004.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-004.in	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,10 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+#NetworkManager#iface eth0 inet dhcp
diff -Nru network-manager-0.9.4.0/debian/tests/if-004.out network-manager-0.9.4.0/debian/tests/if-004.out
--- network-manager-0.9.4.0/debian/tests/if-004.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-004.out	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,10 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+#NetworkManager#iface eth0 inet dhcp
diff -Nru network-manager-0.9.4.0/debian/tests/if-005.in network-manager-0.9.4.0/debian/tests/if-005.in
--- network-manager-0.9.4.0/debian/tests/if-005.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-005.in	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,68 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+allow-hotplug usb0
+
+iface usb0 inet static
+    address 192.168.111.2
+    netmask 255.255.255.0
+
+#auto eth0
+#iface eth0 inet static
+#	address 192.168.20.80
+#	netmask 255.255.255.0
+
+# The primary network interface
+allow-hotplug eth0
+iface eth0 inet dhcp
+
+allow-hotplug wlan0
+#iface wlan0 inet dhcp
+
+mapping wlan0
+	script ifscheme-mapping
+
+iface wlan0-test0 inet dhcp
+#iface wlan0 inet dhcp
+	wpa-driver wext
+	wpa-ssid test0
+	wpa-ap-scan 1
+	wpa-proto RSN
+	wpa-pairwise CCMP
+	wpa-group CCMP
+	wpa-key-mgmt WPA-PSK
+	wireless-txpower 42mW
+	wireless-rate auto
+#	wireless-essid test0
+#	wireless-channel 11
+#	wireless-defaultkey 1
+
+iface wlan0-test1 inet dhcp
+	wireless-essid test1
+	wireless-channel 9
+	wireless-defaultkey 1
+	wireless-ap 00:0E:8E:02:84:58
+
+iface wlan0-test2 inet dhcp
+	wireless-essid test2
+	wireless-defaultkey 1
+	wireless-ap auto
+	wireless-txpower 42mW
+
+iface wlan0-test3 inet dhcp
+	wpa-driver wext
+	wpa-ssid Test3
+	wpa-ap-scan 1
+	wpa-proto RSN
+	wpa-pairwise CCMP
+	wpa-group CCMP
+	wpa-key-mgmt WPA-PSK
+
+iface wlan0-default inet dhcp
+	wireless-ap auto
+	wireless-txpower 42mW
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-005.out network-manager-0.9.4.0/debian/tests/if-005.out
--- network-manager-0.9.4.0/debian/tests/if-005.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-005.out	2012-11-28 21:29:51.000000000 +0100
@@ -0,0 +1,68 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+allow-hotplug usb0
+
+iface usb0 inet static
+    address 192.168.111.2
+    netmask 255.255.255.0
+
+#auto eth0
+#iface eth0 inet static
+#	address 192.168.20.80
+#	netmask 255.255.255.0
+
+# The primary network interface
+allow-hotplug eth0
+#NetworkManager#iface eth0 inet dhcp
+
+allow-hotplug wlan0
+#iface wlan0 inet dhcp
+
+mapping wlan0
+	script ifscheme-mapping
+
+iface wlan0-test0 inet dhcp
+#iface wlan0 inet dhcp
+	wpa-driver wext
+	wpa-ssid test0
+	wpa-ap-scan 1
+	wpa-proto RSN
+	wpa-pairwise CCMP
+	wpa-group CCMP
+	wpa-key-mgmt WPA-PSK
+	wireless-txpower 42mW
+	wireless-rate auto
+#	wireless-essid test0
+#	wireless-channel 11
+#	wireless-defaultkey 1
+
+iface wlan0-test1 inet dhcp
+	wireless-essid test1
+	wireless-channel 9
+	wireless-defaultkey 1
+	wireless-ap 00:0E:8E:02:84:58
+
+iface wlan0-test2 inet dhcp
+	wireless-essid test2
+	wireless-defaultkey 1
+	wireless-ap auto
+	wireless-txpower 42mW
+
+iface wlan0-test3 inet dhcp
+	wpa-driver wext
+	wpa-ssid Test3
+	wpa-ap-scan 1
+	wpa-proto RSN
+	wpa-pairwise CCMP
+	wpa-group CCMP
+	wpa-key-mgmt WPA-PSK
+
+iface wlan0-default inet dhcp
+	wireless-ap auto
+	wireless-txpower 42mW
+
diff -Nru network-manager-0.9.4.0/debian/tests/if-006.in network-manager-0.9.4.0/debian/tests/if-006.in
--- network-manager-0.9.4.0/debian/tests/if-006.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-006.in	2012-11-28 21:57:34.000000000 +0100
@@ -0,0 +1,12 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+#auto eth0
+#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+#iface eth0 inet6 auto
diff -Nru network-manager-0.9.4.0/debian/tests/if-006.out network-manager-0.9.4.0/debian/tests/if-006.out
--- network-manager-0.9.4.0/debian/tests/if-006.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-006.out	2012-11-28 21:55:46.000000000 +0100
@@ -0,0 +1,12 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+#auto eth0
+#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+#iface eth0 inet6 auto
diff -Nru network-manager-0.9.4.0/debian/tests/if-007.in network-manager-0.9.4.0/debian/tests/if-007.in
--- network-manager-0.9.4.0/debian/tests/if-007.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-007.in	2012-11-28 21:59:38.000000000 +0100
@@ -0,0 +1,11 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# eth0 is the ethernet card
+auto eth0
+iface eth0 inet dhcp
+# network-manager
diff -Nru network-manager-0.9.4.0/debian/tests/if-007.out network-manager-0.9.4.0/debian/tests/if-007.out
--- network-manager-0.9.4.0/debian/tests/if-007.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-007.out	2012-11-28 21:59:48.000000000 +0100
@@ -0,0 +1,11 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# eth0 is the ethernet card
+auto eth0
+#NetworkManager#iface eth0 inet dhcp
+# network-manager
diff -Nru network-manager-0.9.4.0/debian/tests/if-008.in network-manager-0.9.4.0/debian/tests/if-008.in
--- network-manager-0.9.4.0/debian/tests/if-008.in	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-008.in	2012-11-28 22:01:02.000000000 +0100
@@ -0,0 +1,20 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto eth0
+iface eth0 inet manual
+
+auto br0
+iface br0 inet dhcp
+	bridge_ports eth0
+	bridge_stp off
+	bridge_fd 0
+
+#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+#iface eth0 inet6 auto
diff -Nru network-manager-0.9.4.0/debian/tests/if-008.out network-manager-0.9.4.0/debian/tests/if-008.out
--- network-manager-0.9.4.0/debian/tests/if-008.out	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/if-008.out	2012-11-28 22:04:55.000000000 +0100
@@ -0,0 +1,20 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto eth0
+iface eth0 inet manual
+
+auto br0
+#NetworkManager#iface br0 inet dhcp
+#NetworkManager#	bridge_ports eth0
+#NetworkManager#	bridge_stp off
+#NetworkManager#	bridge_fd 0
+
+#iface eth0 inet dhcp
+# This is an autoconfigured IPv6 interface
+#iface eth0 inet6 auto
diff -Nru network-manager-0.9.4.0/debian/tests/Makefile network-manager-0.9.4.0/debian/tests/Makefile
--- network-manager-0.9.4.0/debian/tests/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ network-manager-0.9.4.0/debian/tests/Makefile	2012-11-28 22:30:40.000000000 +0100
@@ -0,0 +1,20 @@
+#!/usr/bin/make -f
+
+tests: ifbmsh_test
+
+IFBMSH := ../ifblacklist_migrate.sh
+IFBMSH_TESTS := if-000 if-001 if-002 if-003 if-004 if-005 if-006 if-007 if-008
+
+ifbmsh_test: $(IFBMSH)
+	@for i in $(IFBMSH_TESTS); do \
+		echo -n "Testing $$i: "; \
+		cp $${i}.in $${i}.test ; \
+		NIF_FILE=$${i}.test sh $(IFBMSH) > /dev/null ; \
+		if cmp -s $${i}.out $${i}.test; then echo "OK"; \
+		else echo "FAIL"; exit 1; fi; \
+	done
+
+clean:
+	rm -f if-*.test*
+
+.PHONY: tests ifbmsh_test clean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20121129/53f299ae/attachment-0005.pgp>


More information about the Pkg-utopia-maintainers mailing list