This is part of the steps to remove usage of six library, which is no
longer needed since python 2 support was removed.
Change-Id: Ic0b3687c47b6f3ac51858084bcf11a5c5a185759
Label validator function has been left behind, although it's not
checking for anything right now - might be useful in future.
Change-Id: I74c744dc957d73aef7556aff00837611dadbada7
The API for delete_namespaced_service requires a body which when
missing will fail the functional tests.
This patch addresses that issue by adding an empty body in order
for the delete to work properly.
Change-Id: I3b4a4bb08f60d9d18368dd3faa84ab1348acb543
Story: #2002589
Task: #28341
At the moment, if a cluster fails to be created, we fall back to
getting the node information from Heat directly. However, this
behaviour doesn't work at the moment because `self.cluster` is
a copy of the API record on-create which does not have the stack
ID yet.
This patch makes an extra HTTP request to get the `stack_id` in
order to get the server IPs and be able to pull down the correct
information.
Story: #2002589
Task: #28341
Change-Id: I3fb3542f8ab63f38a23094d579d3df1fcb99a497
Due to a few several small connected patches for the
fedora atomic driver, this patch includes 4 smaller patches.
Patch 1:
k8s: Do not start kubelet and kube-proxy on master
Patch [1], misses the removal of kubelet and kube-proxy from
enable-services-master.sh and therefore they are started if they
exist in the image or the script will fail.
https://review.openstack.org/#/c/533593/
Closes-Bug: #1726482
Patch 2:
k8s: Set require-kubeconfig when needed
From kubernetes 1.8 [1] --require-kubeconfig is deprecated and
in kubernetes 1.9 it is removed.
Add --require-kubeconfig only for k8s <= 1.8.
[1] https://github.com/kubernetes/kubernetes/issues/36745
Closes-Bug: #1718926https://review.openstack.org/#/c/534309/
Patch 3:
k8s_fedora: Add RBAC configuration
* Make certificates and kubeconfigs compatible
with NodeAuthorizer [1].
* Add CoreDNS roles and rolebindings.
* Create the system:kube-apiserver-to-kubelet ClusterRole.
* Bind the system:kube-apiserver-to-kubelet ClusterRole to
the kubernetes user.
* remove creation of kube-system namespaces, it is created
by default
* update client cert generation in the conductor with
kubernetes' requirements
* Add --insecure-bind-address=127.0.0.1 to work on
multi-master too. The controller manager on each
node needs to contact the apiserver (on the same node)
on 127.0.0.1:8080
[1] https://kubernetes.io/docs/admin/authorization/node/
Closes-Bug: #1742420
Depends-On: If43c3d0a0d83c42ff1fceffe4bcc333b31dbdaab
https://review.openstack.org/#/c/527103/
Patch 4:
k8s_fedora: Update coredns config to pass e2e
To pass the e2e conformance tests, coredns needs to
be configured with POD-MODE verified. Otherwise, pods
won't be resolvable [1].
[1] https://github.com/coredns/coredns/tree/master/plugin/kuberneteshttps://review.openstack.org/#/c/528566/
Closes-Bug: #1738633
Change-Id: Ibd5245ca0f5a11e1d67a2514cebb2ffe8aa5e7de
After [1] jobs are return false(SUCCESS) status due
to wrong EXIT_CODE.
After [2] kubernetes client is updated to v4.0.0 and
no longer contains ConfiugrationObject so we need create
instance of Configuration class.
Also don't use local to create variable as local
can only be used in a function.
[1] https://review.openstack.org/#/c/526618/
[2] https://review.openstack.org/#/c/528406
Change-Id: Ida5aac40b234a358b2a13b2e51a41d0242031ebb
we create clients in the functional tests by passing
auth parameters, which is deprecated since a long time
ago. use keystoneauth sessions instead.
Change-Id: Id0db54f43cf5afa8da95cf537334b20eaed7c4e2
* Swarm-mode is the fastest cluster to deploy since it doesn't
require to pull anything from outside.
* Add the output nodes for swarm-mode too.
* Disable copy logs (I think a better practice is to copy logs
on demand).
* Don't run test_create_list_sign_delete_clusters, because it is
very unstable on the CI.
Partially-Implements: blueprint swarm-mode-support
2nd commit message:
Update to Fedora Atomic 26
This patch moves the current master to test against Fedora Atomic 26,
in addition, it switches to downloading from Fedora mirrors.
2nd-Change-Id: I9a97c0eb78b2c9d10e8be1501babb19e73ee70c1
3rd commit message:
Set default iptables FORWARD policy to ACCEPT
With the release of Docker 1.13 which is available in Fedora
Atomic 26, it no longer sets the policy of the FORWARD chain
to ACCEPT[1]. Therefore, CNI networking such as Flannel will
cease to work.
This patch sets the policy to ACCEPT so that traffic can work
once again for deployments which are based on Docker versions
which are newer than 1.13
[1]: https://github.com/moby/moby/pull/28257
3rd-Change-Id: I1457602748619f38f87542fc01a2996ee80e58b7
Closes-Bug: #1708454
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
Change-Id: I86d4dcc94fff622be4ee2acc8dd60ed81bc5d433
- Use addOnCleanup instead of addOnException. This will make copy
logs to run whether tests pass or fail.
- Also try to copy logs if setupClass Fails.
Change-Id: I76b135ade4c1ed4987f9bcbe1d5ded09ad57deb9
Multiple process workers support for magnum-conductor.
Adds new option 'workers' to group [conductor] of magnum.conf.
Change-Id: If4d47769c97f756dbf5f45ac4413df7971731f21
Implements: blueprint magnum-multiple-process-workers
For a really long time, we generated and maintained our very own python
client generated from kubernetes swagger json files. Now in Kubernetes
Community there is a concerted effort to organize an official python
client (also generated from swagger) for everyone to use. So let us
please switch over from our python-k8sclient and use the community
driven python client. I have ported all of our end-to-end tests and got
them working in kubernetes client-python project upstream so we should
be protected from regressions.
Implements: blueprint replace-k8sclient-with-upstream-kubernetes-client
Depends-On: I72359f2b811392008eb5267812bf343797b1553a
Change-Id: Ib81a69cfdc25198e259e3b3d4081c92c01fd1bc5
This will give admins a way to revoke access to an existing cluster
once a user has been granted access.
Bumped the API microversion to 1.5 for the new endpoint.
Deprecated policy certificate:get in favor of certificate:get_ca for
clarity and consistency.
Depends-On: Ie960464e45445e195e75b91e8d65a4046eb21e93
Implements: blueprint revoke-cluster-cert
Change-Id: Ief28bef3a79f212acf4166e443a96e5419fbb757
String interpolation should be delayed to be handled by the logging code,
rather than being done at the point of the logging call.
Ref:http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation
For example:
LOG.info(_LI('some message: variable=%s') % variable)
LOG.info(_LI('some message: variable=%s'), variable)
Change-Id: Ifaf1dfe589615732e412c4e640cf46679abc9023
Closes-Bug: #1643463
To unblock our gate, in all the functional tests, create
clusters without cinder volumes.
Change-Id: Ia3b14603c5fc516b00c862c8b9257e0fd23d4b9e
Related-Bug: #1422831
* Update functional_creds.conf.sample
* and functional_creds.conf in post_gate_hook
* Update python_client_base to use keystone v3 credentials
* Get magnum_url from magnum.conf
Closes-Bug: #1474152
Change-Id: If1ce6e77396857fef68c5c288f0b1c7fecb0b4d4
This patch fixes the issue when functional tests are run
against a deployment that has https based endpoints.
The insecure option is not being passed when initiating
magnumclient or keystoneclient as a result we get SSL
error.
Change-Id: I35525917b96b64e57c984924c72b3c696949f67f
Closes-Bug: #1640341
This is patch #2 of 3 to rename the term bay to cluster within
the internal references and objects of magnum. This patch changes
all references to the certificate objects bay_uuid field to
cluster_uuid. Certifcate does not have a db table so no db
changes were made. No functionality is changed by this patch,
just internal naming.
Change-Id: I68a3b87b75b49de43a7855355807b50a4ae695f3
Implements: blueprint rename-bay-to-cluster
This patch updates the functional tests to use the client cluster
commands instead of bay commands. Bay and BayModel tests remain
in the functional API tests to test backwards compatiblity, but
all other functional tests will use the new Cluster and
ClusterTemplate versions.
Change-Id: Ib86f39caba04b7e81754da2db51d36470c4f3660
Implements: blueprint rename-bay-to-cluster
This reverts commit 15162ce33a.
Mesos services were not working, so reverted the patch
which renamed slave to agent.
Change-Id: I94a9a36e649f48f8e31386226226261ef459ce25
Closes-Bug: #1617407
Added i18n translation to all log messages. Also added
hacking check for this to ensure in future all log
messages are translated.
Change-Id: I77fbb18ffe47b12232125cc1fa7aae97ea9b1214
Closes-Bug: #1603759
`_get_nodes_from_stack` will be never called because `_get_nodes_from_bay`
always return un-empty list if master_addresses and node_addresses are
None. So we can't get logs unless bay is succeeded to create.
This patch fixes this issue, so we can get node logs if bay is not create
completed.
Change-Id: I6e518359d08cf06e95adc0b324c934c8f3e0c27d
Closes-Bug: #1605092
The tempest tests (gate-functional-dsvm-magnum-api) requires
importing modules that other tests don't require. Right now, we
import tempest modules in the common base class, which is
undesirable. This commit splitted tempest codes out so that other
tests don't need to import tempest modules.
Change-Id: I4871acdc27d66e098e2321809d7d31d4e8416abf
Related-Bug: #1596778
Closes-Bug: #1553035
Mesos community has renamed slave to agent. This change reflect
this renaming in the code.
Change-Id: Ic97a827345b62f812ed63180cd1f5820e2200682
Closes-Bug: #1516188
Bay_create_timeout default is 0 and means that magnum create bay
without timeout. But heat create stack with timeout absolutely.
So it is impossible to create bay without timeout. And I had send
a patch which allow heat to create stack without timeout, but the
core of heat did not agree with it.
The patch is: https://review.openstack.org/#/c/334138/
Change-Id: Iebc9915dcf2894a2dbed912244a2c7c308b4d9d7
Closes-bug: #1590636
After this patch [1], Magnum is no longer the "Container Service", it
became the "Container Infrastructure Management Service". This commit
updates the service name and description accordingly:
* Change service name from "container" to "container-infra"
* Update service description to reflect its mission
[1] https://review.openstack.org/#/c/311476/
Depends-On: I55205ff2b304678d2b53bbd4d66403078c6baac8
Closes-Bug: #1584251
Change-Id: I5c271bf3fc4d6ccecaf2918aca28ce946bcc6b22
* Add a CoreOS test class TestCoreosKubernetesAPIs
* Add a CoreOS test environment in tox.ini
* Create a base class BaseK8sTest and move OS-agnostic k8s testing
code to that class.
* Increase the disk size from 8G to 10G for m1.magnum and s1.magnum,
since CoreOS image requires more disk space to boot.
* Set os-distro property for CoreOS image.
Partial-Bug: #1546101
Change-Id: Ie56a9442ecebe05f39c7669bc950f5a6ca11df33
If the bay is pending on CREATE_IN_PROCESS, it won't contain the
IP addresses of the nodes. Therefore, we need to get them from
the Heat stack if missing.
Closes-Bug: #1571272
Change-Id: I487f9000b4c229be3e1b576258473e39cda66f9e
It's hard to indentify which node is master and which is slave now, add
prefix `master` or `node` to logs directory on functional testing
failure.
Change-Id: Ida739845d5276d53b037ac32dcb1b72bc717936f
Setting the following in functional_creds.conf doesn't have any effect
for failed functional container tests:
copy_logs = False
Description of changes/issues addressed:
- Client functional tests look in functional_creds.conf for the
copy_logs setting while tempest/api tests look in tempest.conf.
So an accessor method 'get_copy_logs' is added for BaseMagnumTest
(for tempest tests), and this gets overridden by BaseMagnumClient.
- Call to lamda was missing an argument in copy_logs_handler.
- set_copy_logs in config.py was setting cls.copy logs inconsistently
(sometimes boolean True, otherwise to a string).
- BaseMagnumClient was calling bool() on a string: "bool(copy_logs)".
bool() on a string always returns True except for null string.
Change-Id: I234fd0433602914fdf03f04f2394f6dc802df4fd
Closes-Bug: #1570949
The Magnum functional tests currently use a DNS server setting of
8.8.8.8 when configuring nodes in a cluster. In some environments,
this DNS server setting doesn't work. When this is the case, and
functional tests are run locally, bay creation times out and the
functional tests fail.
This patch enhances the functional tests to allow configuration of
DNS nameserver to be used in baymodels that are created in
functional tests.
Change-Id: I958d199565ae5741dd6f4b8764e51ea16a8d505b
Closes-Bug: #1570543
Make thhe minions work correctly without depending on the master.
Removing this dependency decreases provisioning time by provisioning
nodes in parallel.
Change-Id: I025dbf54ef0cdafc4fe26acc33a9faed8cacd1ca
Partial-Bug: 1536739
Partial-Bug: 1551824
This patch will copy logs from nova servers to local environment
on test failures.
Don't delete bays until teardown so log gathering will work.
Give functional test types a common base.
Added timeout to docker ps; else, the command would time out,
failing to run the rest of the tests.
Closes-Bug: 1542390
Change-Id: I016ed8fe311bede407f57b7982126c4b77749bec
Co-Authored-By: Corey O'Brien <coreypobrien@gmail.com>
These two changes have to merge together to pass the gate.
Update import because of magnum client change
Magnum client has moved out apiclient and cliutils from
oslo-incubator, update the import reference here.
Refer to:
https://review.openstack.org/#/c/280050
for magnumclient change.
Change SERVICE_TENANT_NAME to SERVICE_PROJECT_NAME
Devstack is converting from TENANT to PROJECT[1]. This patch changes
SERVICE_TENANT_NAME to SERVICE_PROJECT_NAME in the devstack plugin to
match.
[1] https://review.openstack.org/#/c/281779/
Change-Id: Ib03e421e48a3aa40c11cbc892a3ca724cbd644e7
Closes-Bug: #1548634
Co-Authored-By: Yang Hongyang <hongyang.yang@easystack.cn>
Removed some COE tests that duplicate the functional-api tests.
Consolidated duplicate code around certificates and made BayTest
always create and delete a bay so that the COE api tests can all
work off of a single bay per class.
Change-Id: I2ff7e2fd587657fb4dd171c1470c5bb208c331b5
Closes-Bug: 1544196
Recently, the gate jobs took too long to complete (between 2 to 8
hours). The reason is jenkins slave agent die during the test, which
cause the CI to re-start the whole test in a new VM.
The failure mainly occurred at magnum-api pipeline, but also occurred
at other pipelines. In term of distribution of test nodes, this
failure mainly occurred at OVH nodes, in which there is no dedicated
swap device. As a result, at OVH nodes, local disk is used for swap
when memory is over-consuming. It looks this leads to resource
starvation, which cause the failure.
This patch attempted to reduce the memory consumption of the gate
tests. In the api test, the number of worker nodes was reduced from
2 to 1. In all tests (api/k8s/swarm/mesos), the memory of worker node
was reduced from 1G to 512M.
Closes-Bug: #1542386
Change-Id: If7822d07f95ebc935a8763b92f038f10cf07b5ca