How to use the broker.utils function in broker

To help you get started, we’ve selected a few broker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github quattor / aquilon / tests / broker / test_grns.py View on Github external
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for testing GRN support."""

if __name__ == "__main__":
    from broker import utils
    utils.import_depends()

import unittest2 as unittest
from broker.brokertest import TestBrokerCommand
from broker.grntest import VerifyGrnsMixin


class TestGrns(VerifyGrnsMixin, TestBrokerCommand):

    def test_100_add_test1(self):
        self.assert_("grn:/ms/test1" not in self.grns)
        self.assert_(1 in self.eon_ids)
        command = ["add", "grn", "--grn", "grn:/ms/test1", "--eon_id", "1",
                   "--disabled"]
        self.noouttest(command)

    def test_101_verify_test1(self):
github quattor / aquilon / tests / broker / test_reset_advertised_status.py View on Github external
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for testing the reset advertised status command."""

import re

import unittest

if __name__ == "__main__":
    import broker.utils
    broker.utils.import_depends()

from broker.brokertest import TestBrokerCommand


class TestResetAdvertisedStatus(TestBrokerCommand):
    """ test reset advertised status """

    def test_100_aquilon(self):
        """ test reset advertised status on various build status """

        hostname = "unittest02.one-nyp.ms.com"
        # we start off as "ready", so each of these transitions (in order)
        # should be valid
        for status in ['failed', 'rebuild', 'ready']:
            self.successtest(["change_status", "--hostname", hostname,
                              "--buildstatus", status])
github quattor / aquilon / tests / broker / test_update_address.py View on Github external
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for testing the update address command."""

import unittest

if __name__ == "__main__":
    from broker import utils
    utils.import_depends()

from broker.brokertest import TestBrokerCommand


class TestUpdateAddress(TestBrokerCommand):

    def test_100_update_reverse(self):
        self.dsdb_expect_update("arecord15.aqd-unittest.ms.com",
                                comments="Some address comments")
        command = ["update", "address",
                   "--fqdn", "arecord15.aqd-unittest.ms.com",
                   "--reverse_ptr", "arecord14.aqd-unittest.ms.com",
                   "--comments", "Some address comments"] + self.valid_just_tcm
        self.noouttest(command)
        self.dsdb_verify()
github quattor / aquilon / tests / broker / test_update_service_address.py View on Github external
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for testing the update_service_address command."""

import unittest

if __name__ == "__main__":
    from broker import utils
    utils.import_depends()

from broker.brokertest import TestBrokerCommand


class TestUpdateServiceAddress(TestBrokerCommand):

    def test_100_remove_eth1(self):
        self.noouttest(["update_service_address",
                        "--hostname", "unittest20.aqd-unittest.ms.com",
                        "--name", "hostname", "--interfaces", "eth0"])

    def test_101_verify_eth1_removed(self):
        ip = self.net["zebra_vip"].usable[2]
        eth0_ip = self.net["zebra_eth0"].usable[0]
        eth1_ip = self.net["zebra_eth1"].usable[0]
        command = ["show", "host", "--hostname", "unittest20.aqd-unittest.ms.com"]