test_ospluginutils.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. # -*- coding: utf-8 -*-
  2. # vim: tabstop=4 shiftwidth=4 softtabstop=4
  3. # Copyright 2013, Red Hat, Inc.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. # not use this file except in compliance with the License. You may obtain
  7. # a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. # License for the specific language governing permissions and limitations
  15. # under the License.
  16. from unittest import TestCase
  17. from ..test_base import PackstackTestCaseMixin
  18. from packstack.modules.ospluginutils import gethostlist
  19. class OSPluginUtilsTestCase(PackstackTestCaseMixin, TestCase):
  20. def test_gethostlist(self):
  21. conf = {"A_HOST": "1.1.1.1", "B_HOSTS": "2.2.2.2,1.1.1.1",
  22. "C_HOSTS": "3.3.3.3/vdc"}
  23. hosts = gethostlist(conf)
  24. hosts.sort()
  25. self.assertEqual(['1.1.1.1', '2.2.2.2', '3.3.3.3'], hosts)