pf-tools/pf-tools: 2 new changesets

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Thu Dec 11 17:22:03 UTC 2014


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/e8aaf79b26db
changeset: 1378:e8aaf79b26db
user:      shad
date:      Thu Dec 11 18:18:52 2014 +0100
description:
addmount test file

details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/3e98409d7538
changeset: 1379:3e98409d7538
user:      shad
date:      Thu Dec 11 18:22:00 2014 +0100
description:
move test config files at their new position

diffstat:

 t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/ports.conf              |   23 +
 t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/sites-available/default |   14 +
 t/13.conf.cfg1/config-export/spawn/etc/apache2/ports.conf                   |   23 -
 t/13.conf.cfg1/config-export/spawn/etc/apache2/sites-available/default      |   14 -
 t/14.addmount.t                                                             |  122 ++++++++++
 5 files changed, 159 insertions(+), 37 deletions(-)

diffs (216 lines):

diff -r 54f8650d8120 -r 3e98409d7538 t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/ports.conf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/ports.conf	Thu Dec 11 18:22:00 2014 +0100
@@ -0,0 +1,23 @@
+# If you just change the port or add more ports here, you will likely also
+# have to change the VirtualHost statement in
+# /etc/apache2/sites-enabled/000-default
+# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
+# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
+# README.Debian.gz
+
+NameVirtualHost *:80
+Listen 80
+
+<IfModule mod_ssl.c>
+    # If you add NameVirtualHost *:443 here, you will also have to change
+    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
+    # to <VirtualHost *:443>
+    # Server Name Indication for SSL named virtual hosts is currently not
+    # supported by MSIE on Windows XP.
+    Listen 443
+</IfModule>
+
+<IfModule mod_gnutls.c>
+    Listen 443
+</IfModule>
+
diff -r 54f8650d8120 -r 3e98409d7538 t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/sites-available/default
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/t/13.conf.cfg1/config-export/FILE/spawn/etc/apache2/sites-available/default	Thu Dec 11 18:22:00 2014 +0100
@@ -0,0 +1,14 @@
+<VirtualHost *:80>
+	ServerAdmin webmaster at localhost
+
+	ErrorLog ${APACHE_LOG_DIR}/error.log
+
+	# Possible values include: debug, info, notice, warn, error, crit,
+	# alert, emerg.
+	LogLevel warn
+
+	CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+	WSGIScriptAliasMatch ^(.*)$ /var/www/vhosts/hg/cgi-bin/hgwebdir.wsgi/$1
+
+</VirtualHost>
diff -r 54f8650d8120 -r 3e98409d7538 t/13.conf.cfg1/config-export/spawn/etc/apache2/ports.conf
--- a/t/13.conf.cfg1/config-export/spawn/etc/apache2/ports.conf	Thu Dec 11 17:52:36 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# If you just change the port or add more ports here, you will likely also
-# have to change the VirtualHost statement in
-# /etc/apache2/sites-enabled/000-default
-# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
-# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
-# README.Debian.gz
-
-NameVirtualHost *:80
-Listen 80
-
-<IfModule mod_ssl.c>
-    # If you add NameVirtualHost *:443 here, you will also have to change
-    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
-    # to <VirtualHost *:443>
-    # Server Name Indication for SSL named virtual hosts is currently not
-    # supported by MSIE on Windows XP.
-    Listen 443
-</IfModule>
-
-<IfModule mod_gnutls.c>
-    Listen 443
-</IfModule>
-
diff -r 54f8650d8120 -r 3e98409d7538 t/13.conf.cfg1/config-export/spawn/etc/apache2/sites-available/default
--- a/t/13.conf.cfg1/config-export/spawn/etc/apache2/sites-available/default	Thu Dec 11 17:52:36 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<VirtualHost *:80>
-	ServerAdmin webmaster at localhost
-
-	ErrorLog ${APACHE_LOG_DIR}/error.log
-
-	# Possible values include: debug, info, notice, warn, error, crit,
-	# alert, emerg.
-	LogLevel warn
-
-	CustomLog ${APACHE_LOG_DIR}/access.log combined
-
-	WSGIScriptAliasMatch ^(.*)$ /var/www/vhosts/hg/cgi-bin/hgwebdir.wsgi/$1
-
-</VirtualHost>
diff -r 54f8650d8120 -r 3e98409d7538 t/14.addmount.t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/t/14.addmount.t	Thu Dec 11 18:22:00 2014 +0100
@@ -0,0 +1,122 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Cwd;
+use English qw( -no_match_vars );    # Avoids regex performance penalty
+use File::Copy;
+use File::Path qw( make_path remove_tree );
+use Hash::Merge::Simple qw( clone_merge merge );
+use IO::File;
+use Sys::Hostname;
+use Test::Exception;
+use Test::More qw( no_plan );
+
+use PFTools::Conf;
+use PFTools::Structqueries;
+use PFTools::Update::ADDMOUNT;
+
+########################################################################
+
+my $test_config_file = 't/13.conf.cfg1/etc/pf-tools.1.conf';
+my $test_pf_config
+    = init_pf_config($test_config_file);    # already tested OK above
+
+my $cwd             = getcwd;
+my $test_config_dir = qq{$cwd/t/13.conf.cfg1};
+my $test_hostname   = q{cbv4-spawn00};
+my $test_hash_subst
+    = init_subst( $test_hostname, undef, $test_pf_config, 'private' );
+
+# bypass cvs/svn/whatever for the moment
+unlink q{/tmp/pf-test/var/lib/cvsguest/config};
+make_path(q{/tmp/pf-test/var/lib/cvsguest});
+symlink qq{$cwd/t/13.conf.cfg1/config-export},
+    q{/tmp/pf-test/var/lib/cvsguest/config}
+    or diag qq{symlink: $OS_ERROR};
+
+my $parsed_configuration
+    = init_global_netconfig( q{COMMON:private-network}, $test_hash_subst );
+
+#    print Dumper($parsed_configuration);
+########################################################################
+note('Testing PFTools::Update::ADDMOUNT');
+can_ok( 'PFTools::Update::ADDMOUNT', qw( __get_ip_host_from_global ) );
+
+my $global_config = $parsed_configuration;
+my ( $result, $expected_result);
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'cbv4-spawn00', $global_config);
+$expected_result = q{10.1.167.0};
+
+is $result, $expected_result
+    => q{get ip of single site service machine on default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'cbv4-spawn00.vlan-systeme.private', $global_config);
+$expected_result = q{10.1.167.0};
+
+is $result, $expected_result
+    => q{get ip of single site service machine on specified default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'cbv4-spawn00.vlan-pfds-int.private', $global_config);
+$expected_result = q{10.2.167.0};
+
+is $result, $expected_result
+    => q{get ip of single site service machine on specified other network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-all00', $global_config);
+$expected_result = q{10.1.2.10};
+
+is $result, $expected_result
+    => q{get ip of all site server on machine default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-all00.vlan-systeme.private', $global_config);
+$expected_result = q{10.1.2.10};
+
+is $result, $expected_result
+    => q{get ip of all site server on specified default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-several00', $global_config);
+$expected_result = q{10.1.2.20};
+
+is $result, $expected_result
+    => q{get ip of several site server on default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-several00.vlan-systeme.private', $global_config);
+$expected_result = q{10.1.2.20};
+
+is $result, $expected_result
+    => q{get ip of several site server on specified default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'cbv4-pfds-filer00.vlan-systeme.private', $global_config);
+$expected_result = q{10.1.2.0};
+
+is $result, $expected_result
+    => q{get ip of single site server on default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'cbv4-pfds-filer00.vlan-systeme.private', $global_config);
+$expected_result = q{10.1.2.0};
+
+is $result, $expected_result
+    => q{get ip of single site server on specified default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( '10.128.1.2', $global_config);
+$expected_result = q{10.128.1.2};
+
+is $result, $expected_result
+    => q{Return raw input ip}
+        or diag explain $result;
+
+#TODO test other mount like tmpfs by checking fstab resulted file
+
+__END__



More information about the pf-tools-commits mailing list