porthole/kube_utility_container/tests/utility/calico/test_calico_utility_contain...

33 lines
1.3 KiB
Python

# Copyright 2020 AT&T Intellectual Property. All other rights reserved.
#
# 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.
import unittest
from kube_utility_container.tests.utility.base import TestBase
class TestCalicoUtilityContainer(TestBase):
@classmethod
def setUpClass(cls):
cls.deployment_name = 'calicoctl-utility'
super(TestCalicoUtilityContainer, cls).setUpClass()
def test_verify_calico_client_calicoctl_is_present(self):
"""To verify calico-utility calicoctl is present"""
exec_cmd = ['utilscli', 'calicoctl', 'version']
expected = 'Client Version:'
result_set = self.client.exec_cmd(self.deployment_name, exec_cmd)
self.assertIn(
expected, result_set, 'Unexpected value for command: {}, '
'Command Output: {}'.format(exec_cmd, result_set))