diff --git a/magnum/conductor/k8s_api.py b/magnum/conductor/k8s_api.py index f78ee5788e..496a3f1924 100755 --- a/magnum/conductor/k8s_api.py +++ b/magnum/conductor/k8s_api.py @@ -50,14 +50,14 @@ class K8sAPI(core_v1_api.CoreV1Api): (self.ca_file, self.key_file, self.cert_file) = create_client_files(cluster, context) - config = k8s_config.ConfigurationObject() + config = k8s_config.Configuration() config.host = cluster.api_address config.ssl_ca_cert = self.ca_file.name config.cert_file = self.cert_file.name config.key_file = self.key_file.name # build a connection with Kubernetes master - client = api_client.ApiClient(config=config) + client = api_client.ApiClient(configuration=config) super(K8sAPI, self).__init__(client) diff --git a/magnum/tests/contrib/post_test_hook.sh b/magnum/tests/contrib/post_test_hook.sh index e0b1a000a3..7331a84280 100755 --- a/magnum/tests/contrib/post_test_hook.sh +++ b/magnum/tests/contrib/post_test_hook.sh @@ -178,7 +178,8 @@ popd create_test_data $coe $special -local _magnum_tests="" +_magnum_tests="" +target="${coe}${special}" if [[ "api" == "$coe" ]]; then sudo chown -R $USER:stack $BASE/new/tempest @@ -194,6 +195,9 @@ if [[ "api" == "$coe" ]]; then # show tempest config with magnum cat $TEMPEST_CONFIG + # tempest tox env is looking for /etc/tempest/tempest.conf + sudo mkdir -p /etc/tempest + sudo cp $TEMPEST_CONFIG /etc/tempest/tempest.conf # strigazi: don't run test_create_list_sign_delete_clusters because # it is very unstable in the CI @@ -208,13 +212,17 @@ if [[ "api" == "$coe" ]]; then _magnum_tests="$_magnum_tests magnum_tempest_plugin.tests.api.v1.test_cluster.ClusterTest.test_create_cluster_with_zero_masters" _magnum_tests="$_magnum_tests magnum_tempest_plugin.tests.api.v1.test_cluster.ClusterTest.test_delete_cluster_for_nonexisting_cluster" _magnum_tests="$_magnum_tests magnum_tempest_plugin.tests.api.v1.test_cluster.ClusterTest.test_update_cluster_for_nonexisting_cluster" + + pushd $BASE/new/magnum-tempest-plugin + sudo cp $CREDS_FILE . + sudo -E -H -u $USER tox -e functional-"$target" $_magnum_tests -- --concurrency=1 + EXIT_CODE=$? + popd +else + sudo -E -H -u $USER tox -e functional-"$target" $_magnum_tests -- --concurrency=1 + EXIT_CODE=$? fi -target="${coe}${special}" -pushd $BASE/new/magnum-tempest-plugin -sudo -E -H -u $USER tox -e functional-"$target" $_magnum_tests -- --concurrency=1 -popd -EXIT_CODE=$? # Delete the keypair used in the functional test. echo_summary "Running keypair-delete" diff --git a/magnum/tests/functional/python_client_base.py b/magnum/tests/functional/python_client_base.py index 5277cebd82..5163c0daf9 100755 --- a/magnum/tests/functional/python_client_base.py +++ b/magnum/tests/functional/python_client_base.py @@ -440,23 +440,23 @@ class BaseK8sTest(ClusterTest): def setUpClass(cls): super(BaseK8sTest, cls).setUpClass() cls.kube_api_url = cls.cs.clusters.get(cls.cluster.uuid).api_address - config = k8s_config.ConfigurationObject() + config = k8s_config.Configuration() config.host = cls.kube_api_url config.ssl_ca_cert = cls.ca_file config.cert_file = cls.cert_file config.key_file = cls.key_file - k8s_client = api_client.ApiClient(config=config) + k8s_client = api_client.ApiClient(configuration=config) cls.k8s_api = core_v1_api.CoreV1Api(k8s_client) def setUp(self): super(BaseK8sTest, self).setUp() self.kube_api_url = self.cs.clusters.get(self.cluster.uuid).api_address - config = k8s_config.ConfigurationObject() + config = k8s_config.Configuration() config.host = self.kube_api_url config.ssl_ca_cert = self.ca_file config.cert_file = self.cert_file config.key_file = self.key_file - k8s_client = api_client.ApiClient(config=config) + k8s_client = api_client.ApiClient(configuration=config) self.k8s_api = core_v1_api.CoreV1Api(k8s_client) # TODO(coreypobrien) https://bugs.launchpad.net/magnum/+bug/1551824 utils.wait_for_condition(self._is_api_ready, 5, 600)