Commit Graph

66 Commits

Author SHA1 Message Date
Takashi Kajinami aea63db390 Remove six from functional tests
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
2024-02-19 10:43:46 +00:00
Michal Nasiadka 68c8acba39 Remove execution bit on unnecessary files
Change-Id: Ia41b843fdf20154750b129a8ab5dd42f5c3989fb
2024-02-19 00:30:21 +00:00
Michal Nasiadka bc79012f46 Drop Swarm support
Label validator function has been left behind, although it's not
checking for anything right now - might be useful in future.

Change-Id: I74c744dc957d73aef7556aff00837611dadbada7
2024-01-24 13:20:21 +13:00
guilhermesteinmuller 6e8657912c Drop Mesos code
The coe mesos has not been maintained for quite some
time and hasn't got much attention from the community
in general. As discussed in the mailing list [1] we
are dropping for now.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2021-December/026230.html

Co-Authored-By: jake.yip@ardc.edu.au

Change-Id: Ie7de9a37bfad6214f52d0605409e74d62a51df47
2023-03-07 14:02:05 +11:00
Mohammed Naser e0fd3f9ef1 functional: add body for delete_namespaced_service in k8s
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
2018-12-08 22:16:42 -05:00
Mohammed Naser d6cc77b16f functional: retrieve cluster to get stack_id
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
2018-12-08 22:16:42 -05:00
Spyros Trigazis 2329cb7fb4 k8s: Fix kubelet, add RBAC and pass e2e tests
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: #1718926

https://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/kubernetes

https://review.openstack.org/#/c/528566/
Closes-Bug: #1738633

Change-Id: Ibd5245ca0f5a11e1d67a2514cebb2ffe8aa5e7de
2018-02-08 13:35:00 +00:00
yatin 553316e40f Fix: functional CI Jobs
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
2018-01-11 12:50:25 +00:00
Clenimar Filemon 025852826f use keystoneauth1 session in functional test
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
2017-10-16 09:50:23 -03:00
Spyros Trigazis 4fb91cc109 tests: Use swarm-mode for api tests
* 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
2017-08-21 05:30:09 +00:00
yatin fd3c9ef6dd Copy cluster nodes logs always whether tests pass or fail
- 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
2017-07-18 05:32:31 +00:00
coldmoment ba8ad5e37f Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done at the point
of the logging call.
See the oslo i18n guideline
* https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
and
* https://github.com/openstack-dev/hacking/blob/master/hacking/checks/other.py#L39

Change-Id: I8a4f5f896865aebbff88ee894f0081e58cfce9ef
2017-07-15 14:49:45 +08:00
wangbo c50d869670 Support magnum-conductor multiple process workers
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
2017-05-02 02:21:29 +00:00
yuanpeng 71d25456d2 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: If1f4bd2f6be967368f52fb367c5a428d3eb58a9d
Closes-Bug:#1674551
2017-03-30 17:05:10 +08:00
Davanum Srinivas e634b55637 Switch to kubernetes upstream python client
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
2017-02-13 14:48:08 -05:00
Vijendar Komalla daca28d891 Trivial: Fix typo in exception message
Change-Id: I683ba5e13cecad3d8d05dd1ea7cf0fd96b7b34de
2017-01-31 08:02:05 -06:00
Jason Dunsmore a65ef7d3c3 Add an API to rotate a cluster CA certificate
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
2017-01-23 21:26:05 -06:00
melissaml 2ee054c1f5 Modify variable's using method in Log Messages
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
2017-01-04 15:11:33 +08:00
Spyros Trigazis 874d81c1d9 Remove docker_volume_size from functional-test
To unblock our gate, in all the functional tests, create
clusters without cinder volumes.

Change-Id: Ia3b14603c5fc516b00c862c8b9257e0fd23d4b9e
Related-Bug: #1422831
2016-12-08 19:36:02 +01:00
Spyros Trigazis 1f81a4e5df Use keystone v3 for functional tests
* 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
2016-12-05 15:21:09 +01:00
maliki 07f9e027d5 Add insecure option in functional tests for SSL endpoints
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
2016-11-09 21:49:11 -08:00
yatin d07b79cabc Fix typo: clustser-->cluster in python_client_base.py
Change-Id: I3994d682b240bb463b004686cce250b2fa8028fb
2016-10-13 14:13:55 +05:30
Hieu LE 8f9eeb801a Centralize config option: cluster_heat section
Centralize config option of Cluster Heat section.
Replace oslo_conf cfg to magnum.conf.

Change-Id: I9118eeb17061a0aa26269ea9deaba28e79f28b76
Implements: blueprint centralize-config-magnum
2016-09-22 05:56:43 +00:00
Jenkins 42abb07835 Merge "Rename bay to cluster in certificate object and references" 2016-09-01 21:43:28 +00:00
Jenkins 4ab10a1346 Merge "Updates CONF usage from bay to cluster." 2016-09-01 16:10:20 +00:00
Jaycen Grant 8e0de76aff Rename bay to cluster in certificate object and references
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
2016-09-01 08:48:24 -07:00
Stephen Watson 6ead3e4780 Updates CONF usage from bay to cluster.
Renames bay-related CONF options to their respective cluster names.
Adds release notes for CONF changes.

Change-Id: I7bbe0927e54c1f40a47bfdea448a88b467fef106
Implements: blueprint rename-bay-to-cluster
2016-08-31 22:21:34 +00:00
Jaycen Grant 8a6c6a32c2 Rename Bay to Cluster in functional tests
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
2016-08-31 09:00:11 -07:00
yatin 272903ff9e Revert "Update mesos slave to mesos agent"
This reverts commit 15162ce33a.

Mesos services were not working, so reverted the patch
which renamed slave to agent.

Change-Id: I94a9a36e649f48f8e31386226226261ef459ce25
Closes-Bug: #1617407
2016-08-30 08:49:45 +05:30
Jenkins 4176c5cc2a Merge "Add i18n translation for Log messages" 2016-08-15 21:38:05 +00:00
yatin karel fb0057c105 Add i18n translation for Log messages
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
2016-08-15 11:44:08 +05:30
OTSUKA, Yuanying 83e0d8d32b Add functional test for k8s ironic
This patch adds functional test for k8s ironic, and modify
utility scripts for gate jobs.

Partial-Implements: blueprint magnum-baremetal-full-support
Change-Id: I8d68711af9d90e4a52901765e7daf97bc2851125
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
Co-Authored-By: OTSUKA, Yuanying <yuanying@fraction.jp>
2016-08-09 11:30:04 +02:00
OTSUKA, Yuanying 7963f205ce Fix copying logs from nodes
`_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
2016-08-05 17:12:52 +09:00
Hongbin Lu b3de59206d Create a base class for tempest tests
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
2016-07-28 17:59:03 -05:00
Rajiv Kumar 15162ce33a Update mesos slave to mesos agent
Mesos community has renamed slave to agent. This change reflect
this renaming in the code.

Change-Id: Ic97a827345b62f812ed63180cd1f5820e2200682
Closes-Bug: #1516188
2016-07-18 08:51:17 +05:30
PanFengyun f5150078ee Bay_create_timeout should be set to 60 default
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
2016-07-03 23:26:32 +08:00
Hongbin Lu 754233c51d Update Magnum service name and description
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
2016-05-23 15:59:16 -05:00
Hongbin Lu c52e5bea06 Add tox test for k8s coreos bay
* 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
2016-05-09 02:36:26 +00:00
Hongbin Lu d1263387a6 Copy logs if test failed and bay nodes existed
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
2016-05-05 17:19:23 -04:00
Eli Qiao 114c18a9f7 Functional: Add prefix when copy logs on failure
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
2016-04-25 12:59:26 +00:00
Dane LeBlanc dffbabcdc7 Log copy for failed functional tests cannot be disabled
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
2016-04-18 11:22:01 -04:00
Dane LeBlanc 9712370357 Functional tests should support DNS nameserver config
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
2016-04-15 11:39:36 -04:00
Jenkins ea7660ba9f Merge "Remove minion dependency on master" 2016-03-28 20:43:21 +00:00
Hua Wang 22b4be7d7e The type of node_count is number
The type of node_count is number and the default for it is 1. We
should not assign None to it.

Change-Id: I4b2275e84fae3685ec3b98f69253b5fedfc0eac6
2016-03-18 09:44:52 +08:00
Corey O'Brien 08ac9a6cba Remove minion dependency on master
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
2016-03-04 07:41:12 -05:00
dimtruck 7d524491c8 Copy logs on test failure
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>
2016-02-29 10:25:10 -06:00
Corey O'Brien 8270d3cc7a Fix gate for client and devstack
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>
2016-02-23 23:48:26 -05:00
Jenkins 77023b0134 Merge "Bay test cleanup" 2016-02-12 01:36:06 +00:00
Corey O'Brien 7dff331a96 Bay test cleanup
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
2016-02-10 12:49:42 -05:00
Hongbin Lu dca02f1d98 Reduce memory consumption of gate tests
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
2016-02-09 14:05:19 -05:00