pf-tools/pf-tools: 2 new changesets

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Mon Dec 15 18:40:31 UTC 2014


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/f04180edd5e7
changeset: 1389:f04180edd5e7
user:      shad
date:      Mon Dec 15 17:58:20 2014 +0100
description:
update doc

details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/edd211f7c1d4
changeset: 1390:edd211f7c1d4
user:      shad
date:      Mon Dec 15 19:40:28 2014 +0100
description:
another addmount test: trying to get the public ip of a filer only on another site

diffstat:

 doc/updatefile-syntax                               |  14 +++-
 t/13.conf.cfg1/config-export/COMMON/private-network |   9 ++
 t/13.conf.t                                         |  89 ++++++++++++++++++++-
 t/20.files.t                                        |  11 ++
 t/31.addmount.t                                     |  18 +++-
 5 files changed, 137 insertions(+), 4 deletions(-)

diffs (266 lines):

diff -r 5ec9718235d3 -r edd211f7c1d4 doc/updatefile-syntax
--- a/doc/updatefile-syntax	Mon Dec 15 15:45:31 2014 +0100
+++ b/doc/updatefile-syntax	Mon Dec 15 19:40:28 2014 +0100
@@ -177,7 +177,6 @@
 	! action		::= include
 						there are some shortcut defined that resolve to path relatively to VCS root
 						and 'module' defined in pf-tool.conf file
-						 - AUTO:                  try to resolve in order to: 
 						 - CONFIG:                resolve to	/module/CONFIG/
 						 - CONFIGSITE:            resolve to	/module/SITE/pop/CONFIG/	(if the hosttype of machine is pop-bar)
 						 - CONFIGSITE_foo:        resolve to	/module/SITE/foo/CONFIG/
@@ -203,3 +202,16 @@
 						 - SHORTHOSTNAMESITE:     resolve to	/module/SITE/pop/FILE/bar00/	(if the hostname of machine is pop-bar00)
 						 - SHORTHOSTNAMESITE_foo: resolve to	/module/SITE/foo/FILE/bar00/	(if the hostname of machine is pop-bar00)
 						 - ROOT:                  resolve to	/module/
+
+						 - AUTO:                  try to resolve in order to:
+								HOSTNAMESITE:		/SITE/pop/FILE/pop-bar00/
+								HOSTSITE:		/SITE/pop/FILE/pop-bar/
+								HOSTNAME:		/FILE/pop-bar00/
+								HOST:			/FILE/pop-bar/
+								SHORTHOSTNAMESITE:	/SITE/pop/FILE/bar00/
+								SHORTHOSTSITE:		/SITE/pop/FILE/bar
+								FILESITE:common		/SITE/pop/FILE/common/
+								SHORTHOSTNAME: 		/FILE/bar00/
+								SHORTHOST:		/FILE/bar/
+								FILE:common		/FILE/common/
+
diff -r 5ec9718235d3 -r edd211f7c1d4 t/13.conf.cfg1/config-export/COMMON/private-network
--- a/t/13.conf.cfg1/config-export/COMMON/private-network	Mon Dec 15 15:45:31 2014 +0100
+++ b/t/13.conf.cfg1/config-export/COMMON/private-network	Mon Dec 15 19:40:28 2014 +0100
@@ -81,6 +81,15 @@
     ipv4.vlan-systeme   = 2.20
     shortname           = vlan-systeme
 
+[filer-other%%]
+    type                = server
+    site                = cbv4
+    comment             = filer with ip public on other site
+    order               = 2
+    number              = 2
+    ipv4.vlan-public2   = 30
+    shortname           = vlan-public2
+
 [COMMON:/network-common]
     type    = include
 
diff -r 5ec9718235d3 -r edd211f7c1d4 t/13.conf.t
--- a/t/13.conf.t	Mon Dec 15 15:45:31 2014 +0100
+++ b/t/13.conf.t	Mon Dec 15 19:40:28 2014 +0100
@@ -523,6 +523,7 @@
         'cbv4-pfds-filer%%',
         'filer-all%%',
         'filer-several%%',
+        'filer-other%%',
         'vlan-systeme',
         'vlan-pfds-int',
         'vlan-public',
@@ -596,6 +597,15 @@
         'site'              => 'cbv4-pfds, cbv4',
         'type'              => 'server',
     },
+    'filer-other%%' => {
+        'comment'           => 'filer with ip public on other site',
+        'ipv4.vlan-public2' => '30',
+        'number'            => '2',
+        'order'             => '2',
+        'shortname'         => 'vlan-public2',
+        'site'              => 'cbv4',
+        'type'              => 'server',
+    },
     'private' => {
         '@mx' => [
             '1	mf.private.',
@@ -1387,6 +1397,34 @@
                                     }
                             },
                         },
+                        'filer-other' => {
+                            'filer-other01' => {
+                                'interfaces' => {
+                                    'eth0' => {
+                                        'ipv4' => '80.125.164.31/24',
+                                        'vlan' => 'vlan-public2'
+                                    },
+                                },
+                                'deployment' => {
+                                    'hosttype'       => 'filer-other',
+                                    'order'          => '2',
+                                    'hostname_model' => 'filer-other%%'
+                                }
+                            },
+                            'filer-other00' => {
+                                'interfaces' => {
+                                    'eth0' => {
+                                        'ipv4' => '80.125.164.30/24',
+                                        'vlan' => 'vlan-public2',
+                                    },
+                                },
+                                'deployment' => {
+                                    'hosttype'       => 'filer-other',
+                                    'order'          => '2',
+                                    'hostname_model' => 'filer-other%%'
+                                }
+                            },
+                        },
                         'filer-all' => {
                             'filer-all01' => {
                                 'interfaces' => {
@@ -1424,6 +1462,8 @@
                         '10.1.2.11/16' => 'filer-all01.vlan-systeme',
                         '10.1.2.20/16' => 'filer-several00.vlan-systeme',
                         '10.1.2.21/16' => 'filer-several01.vlan-systeme',
+                        '80.125.164.30/24' => 'filer-other00.vlan-public2',
+                        '80.125.164.31/24' => 'filer-other01.vlan-public2',
                         '10.1.167.0/16' => 'cbv4-rdeploy00.vlan-systeme',
                         '10.1.167.1/16' => 'cbv4-rdeploy01.vlan-systeme',
                         '80.125.163.42/24' => 'cbv4-rdeploy00.vlan-public',
@@ -1504,6 +1544,7 @@
                 'ALL_SITES' => {
                     '__hostclass_order' => [
                         'vip-spawn',
+                        'filer-other',
                         'cbv4-spawn',
                         'cbv4-rdeploy',
                     ],
@@ -1560,6 +1601,19 @@
                                                 'A	80.125.164.44',
                         ],
                     },
+                    'filer-other' => {
+                        'filer-other' => 'CNAME	filer-other.vlan-public2',
+                        'filer-other00' => 'CNAME	filer-other00.vlan-public2',
+                        'filer-other01' => 'CNAME	filer-other01.vlan-public2',
+                        'filer-other00.vlan-public2' => 'A	80.125.164.30',
+                        'filer-other01.vlan-public2' => 'A	80.125.164.31',
+                        'number'    => 2,
+                        'comment'   => 'filer with ip public on other site',
+                        'filer-other.vlan-public2'   => [
+                            'A	80.125.164.30',
+                            'A	80.125.164.31',
+                        ],
+                    },
                 },
                 'BY_SITE' => {
                     'cbv4-pfds' => {
@@ -1802,8 +1856,11 @@
             'cbv4-rdeploy'      => 'cbv4',
         },
         'vlan-public2' => {
-            'cbv4-rdeploy'    => 'cbv4',
+            'cbv4-rdeploy'      => 'cbv4',
             'cbv4-rdeploy00'    => 'cbv4',
+            'filer-other'       => 'cbv4',
+            'filer-other01'     => 'cbv4',
+            'filer-other00'     => 'cbv4',
         },
     }
 };
@@ -2380,6 +2437,34 @@
                     }
                 },
             },
+            'filer-other' => {
+                'filer-other01' => {
+                    'interfaces' => {
+                        'eth0' => {
+                            'ipv4' => '80.125.164.31/24',
+                            'vlan' => 'vlan-public2'
+                        },
+                    },
+                    'deployment' => {
+                        'hosttype'       => 'filer-other',
+                        'order'          => '2',
+                        'hostname_model' => 'filer-other%%'
+                    }
+                },
+                'filer-other00' => {
+                    'interfaces' => {
+                        'eth0' => {
+                            'ipv4' => '80.125.164.30/24',
+                            'vlan' => 'vlan-public2',
+                        },
+                    },
+                    'deployment' => {
+                        'hosttype'       => 'filer-other',
+                        'order'          => '2',
+                        'hostname_model' => 'filer-other%%'
+                    }
+                },
+            },
         },
 
         '__hostclass_pxe' => [
@@ -2390,6 +2475,8 @@
             '10.1.2.11/16' => 'filer-all01.vlan-systeme',
             '10.1.2.20/16' => 'filer-several00.vlan-systeme',
             '10.1.2.21/16' => 'filer-several01.vlan-systeme',
+            '80.125.164.30/24' => 'filer-other00.vlan-public2',
+            '80.125.164.31/24' => 'filer-other01.vlan-public2',
             '10.1.167.0/16' => 'cbv4-rdeploy00.vlan-systeme',
             '10.1.167.1/16' => 'cbv4-rdeploy01.vlan-systeme',
             '80.125.163.42/24' => 'cbv4-rdeploy00.vlan-public',
diff -r 5ec9718235d3 -r edd211f7c1d4 t/20.files.t
--- a/t/20.files.t	Mon Dec 15 15:45:31 2014 +0100
+++ b/t/20.files.t	Mon Dec 15 19:40:28 2014 +0100
@@ -258,6 +258,17 @@
     qq{spawn00\tIN CNAME\tcbv4-spawn00.vlan-systeme},
     qq{spawn01\tIN CNAME\tcbv4-spawn01.vlan-systeme},
     q{},
+    q{; filer-other: filer with ip public on other site},
+    q{; number: 2},
+    q{;----------------------------------------------------------------------------},
+    qq{filer-other\tIN CNAME\tfiler-other.vlan-public2},
+    qq{filer-other.vlan-public2\tIN A\t80.125.164.30},
+    qq{filer-other.vlan-public2\tIN A\t80.125.164.31},
+    qq{filer-other00\tIN CNAME\tfiler-other00.vlan-public2},
+    qq{filer-other00.vlan-public2\tIN A\t80.125.164.30},
+    qq{filer-other01\tIN CNAME\tfiler-other01.vlan-public2},
+    qq{filer-other01.vlan-public2\tIN A\t80.125.164.31},
+    q{},
     q{; cbv4-rdeploy: Rdeploy server},
     q{; number: 2},
     q{;----------------------------------------------------------------------------},
diff -r 5ec9718235d3 -r edd211f7c1d4 t/31.addmount.t
--- a/t/31.addmount.t	Mon Dec 15 15:45:31 2014 +0100
+++ b/t/31.addmount.t	Mon Dec 15 19:40:28 2014 +0100
@@ -111,6 +111,20 @@
     => q{get ip of single site server on specified default network}
         or diag explain $result;
 
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-other00', $global_config);
+$expected_result = q{80.125.164.30};
+
+is $result, $expected_result
+    => q{get ip of other site server on default network}
+        or diag explain $result;
+
+$result = PFTools::Update::ADDMOUNT::__get_ip_host_from_global( 'filer-other00.vlan-systeme.private', $global_config);
+$expected_result = q{80.125.164.30};
+
+is $result, $expected_result
+    => q{get ip of other 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};
 
@@ -188,7 +202,7 @@
         or diag explain $result;
 
 
-my $dest = q{/var/tmp/php-sessions};
+$dest = q{/var/tmp/php-sessions};
 $result = PFTools::Update::ADDMOUNT::__build_fstab_entry_from_config({
     'dest'          => $dest,
     'global_config' => $global_config,
@@ -213,7 +227,7 @@
 is_deeply $result, $expected_result
     => q{built fstab entry from generated conf (tmpfs)}
         or diag explain $result;
-my $fstab_result = build_fstab_from_structure({ $dest => $result, '__mnt_order' => [$dest] });
+$fstab_result = build_fstab_from_structure({ $dest => $result, '__mnt_order' => [$dest] });
 
 $expected_result = [
   qq{###################################################},



More information about the pf-tools-commits mailing list