Skip to content

Commit

Permalink
Merge pull request quattor#80 in AQUILON_AQD/aqd from ~AQBLD/aqd:for_…
Browse files Browse the repository at this point in the history
…merge/master/by_topic/fix_test_172_show_utmc8_proto to master

* commit '0eb32f32e4036c5b7e28c0ef0d31db3c5efb5272':
  Fix test_172_show_utmc8_proto for Oracle
  • Loading branch information
Fred Barnes authored and Fred Barnes committed Oct 22, 2019
2 parents e2d90a7 + 0eb32f3 commit 55dc118
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions tests/broker/test_add_metacluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Contributor
# Copyright (C) 2009-2019 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -181,22 +181,37 @@ def test_172_cat_utmc8(self):
command)

def test_172_show_utmc8_proto(self):
# Define expected values for port groups.
net1 = self.net["autopg1"]
net2 = self.net["autopg3"]
expected = [
{
'ip': str(net1.ip),
'network_tag': 710,
'usage': 'user'
},
{
'ip': str(net2.ip),
'network_tag': 123,
'usage': 'customtype'
}
]
command = ["show_metacluster", "--metacluster", "utmc8",
"--format", "proto"]
mc = self.protobuftest(command, expect=1)[0]
self.assertEqual(mc.name, "utmc8")
self.assertEqual(mc.virtual_switch.name, "utvswitch")
self.assertEqual(len(mc.virtual_switch.portgroups), 2)
self.assertEqual(mc.virtual_switch.portgroups[0].ip, str(net1.ip))
self.assertEqual(mc.virtual_switch.portgroups[0].cidr, 29)
self.assertEqual(mc.virtual_switch.portgroups[0].network_tag, 710)
self.assertEqual(mc.virtual_switch.portgroups[0].usage, "user")
self.assertEqual(mc.virtual_switch.portgroups[1].ip, str(net2.ip))
self.assertEqual(mc.virtual_switch.portgroups[1].cidr, 29)
self.assertEqual(mc.virtual_switch.portgroups[1].network_tag, 123)
self.assertEqual(mc.virtual_switch.portgroups[1].usage, "customtype")
actual = mc.virtual_switch.portgroups
# The order of port groups may differ between Oracle and SQLite. Fix.
ordered = actual[0].ip == expected[0]['ip']
if not ordered:
expected.reverse()
for i in (0, 1):
self.assertEqual(actual[i].ip, expected[i]['ip'])
self.assertEqual(actual[i].cidr, 29)
self.assertEqual(actual[i].network_tag, expected[i]['network_tag'])
self.assertEqual(actual[i].usage, expected[i]['usage'])

def test_175_add_utmc9(self):
# FIXME: Localdisk setups should not have a metacluster, but the
Expand Down

0 comments on commit 55dc118

Please sign in to comment.