Change in vdsm[ovirt-3.6]: bonding defaults: for validation, we need to be aware of all...

osvoboda at redhat.com osvoboda at redhat.com
Tue Nov 10 10:53:40 UTC 2015


Ondřej Svoboda has uploaded a new change for review.

Change subject: bonding defaults: for validation, we need to be aware of all options
......................................................................

bonding defaults: for validation, we need to be aware of all options

In the commit b01a096a, we started to use our bonding defaults database
to validate bonding options (by name).  'primary' was not recognized as
a bonding option because its default value is empty.  This patch adds
the rest of valid, but initially empty, options, plus three new ones.

ad_actor_sys_prio, ad_actor_system and ad_user_port_key have recently
been added to the upstream kernel.  primary and arp_ip_target are
empty by default.

Change-Id: Ie2bbd778bb151e4671cc5d3d70ce898e48125331
Bug-Url: https://bugzilla.redhat.com/1262496
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/48008
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/tool/dump_bonding_defaults.py
M tests/functional/networkTests.py
M vdsm/bonding-defaults.json
3 files changed, 46 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/48340/1

diff --git a/lib/vdsm/tool/dump_bonding_defaults.py b/lib/vdsm/tool/dump_bonding_defaults.py
index 262717a..1a0b63a 100644
--- a/lib/vdsm/tool/dump_bonding_defaults.py
+++ b/lib/vdsm/tool/dump_bonding_defaults.py
@@ -47,9 +47,7 @@
             with open(BONDING_OPT % (bond_name, 'mode'), 'w') as opt:
                 opt.write(mode)
 
-            # only read non-empty options
-            opts[mode] = dict(((opt, val) for (opt, val) in
-                               bondOpts(bond_name).iteritems() if val))
+            opts[mode] = bondOpts(bond_name)
             opts[mode]['mode'] = default_mode
 
     finally:
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 90e2176..b844fa7 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -475,10 +475,12 @@
             status, msg = self.setupNetworks(
                 {NETWORK_NAME:
                     {'bonding': BONDING_NAME, 'bridged': bridged}},
-                {BONDING_NAME: {'nics': nics, 'options': 'mode=2'}}, NOCHK)
+                {BONDING_NAME: {'nics': nics, 'options': 'mode=2 arp_ip_target'
+                                '=' + IP_ADDRESS_IN_NETWORK}}, NOCHK)
             self.assertEqual(status, SUCCESS, msg)
             self.assertNetworkExists(NETWORK_NAME, bridged)
-            self.assertBondExists(BONDING_NAME, nics, 'mode=2')
+            self.assertBondExists(BONDING_NAME, nics, 'mode=2 arp_ip_target=' +
+                                  IP_ADDRESS_IN_NETWORK)
 
             status, msg = self.setupNetworks(
                 {NETWORK_NAME: {'remove': True}},
diff --git a/vdsm/bonding-defaults.json b/vdsm/bonding-defaults.json
index b315bd6..e2c5efe 100644
--- a/vdsm/bonding-defaults.json
+++ b/vdsm/bonding-defaults.json
@@ -1,9 +1,12 @@
 {
     "0": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -14,6 +17,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -51,6 +55,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -73,10 +78,13 @@
         ]
     },
     "1": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -87,6 +95,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -124,6 +133,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -146,10 +156,13 @@
         ]
     },
     "2": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -160,6 +173,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -197,6 +211,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -219,10 +234,13 @@
         ]
     },
     "3": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -233,6 +251,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -270,6 +289,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -292,8 +312,17 @@
         ]
     },
     "4": {
+        "ad_actor_sys_prio": [
+            "65535"
+        ],
+        "ad_actor_system": [
+            "00:00:00:00:00:00"
+        ],
         "ad_select": [
             "stable",
+            "0"
+        ],
+        "ad_user_port_key": [
             "0"
         ],
         "all_slaves_active": [
@@ -306,6 +335,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -343,6 +373,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -365,10 +396,13 @@
         ]
     },
     "5": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -379,6 +413,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -416,6 +451,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"
@@ -438,10 +474,13 @@
         ]
     },
     "6": {
+        "ad_actor_sys_prio": [],
+        "ad_actor_system": [],
         "ad_select": [
             "stable",
             "0"
         ],
+        "ad_user_port_key": [],
         "all_slaves_active": [
             "0"
         ],
@@ -452,6 +491,7 @@
         "arp_interval": [
             "0"
         ],
+        "arp_ip_target": [],
         "arp_validate": [
             "none",
             "0"
@@ -489,6 +529,7 @@
         "packets_per_slave": [
             "1"
         ],
+        "primary": [],
         "primary_reselect": [
             "always",
             "0"


-- 
To view, visit https://gerrit.ovirt.org/48340
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2bbd778bb151e4671cc5d3d70ce898e48125331
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>


More information about the vdsm-patches mailing list