* 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
tempest-lib is deprecated for future bug-fixes and code changes
in favor of tempest.
On gate testing, we installed tempest from source code so remove
it from test-requirements.txt.
Closes-Bug: #1553047
Change-Id: I405ad31e1c218868c6dbffb967a755163674fc80
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
In Ia400b5b6919753d6241233a6666a2c30c7618bc9, we are
adding a new library to global requirements. This
python-k8sclient library essentially has the same
code that was in Magnum so it's a straight replace.
Change-Id: Ib85bcf532e4163d5c1ac95ef701a1ec3133b69eb
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
* Rename tenant to project in functional test In particular,
rename "admin_tenant_name" to "admin_project_name" and
rename "tenant_name" to "project_name". These configs have been
renamed in tempest [1], so Magnum needs to adapt the change.
* Temporarily remove "subjectAltName" from CSR config, because
it caused failure of certificate signing, possibly, due to a
bug or imcompatible change in pyOpenSSL 16.0.0.
[1] https://review.openstack.org/#/c/301167/
Change-Id: I41438cbfaefd9d04d7e73a4f46f5ece1494b349c
Closes-Bug: #1568212
Closes-Bug: #1567691
Change the devstack image to the default Atomic 23 image.
Update templates not to rely on interface naming because the names
changed between Atomic 21 and Atomic 23 images.
Add a functional test to validate minion node registration.
Update docs to refer to a generic Atomic image.
Co-Authored-By: Hongbin Lu <hongbin.lu@huawei.com>
Implements: blueprint atomic23
Change-Id: Id67244e3f452b3c7c3c46fdabcca3a5c141a76c0
A better description than magnum2 would be helpful as
we are creating a smaller vm.
So renamed m1.magnum2 to s1.magnum to indicate its a slave flavor.
Change-Id: Ibd74931e0b5b2ac98dc960b31aa2b64a721200ea
Closes-Bug: #1543338
Now, when we update baymodel with the invalid flavor_id or
master_flavor_id parameters, the baymodel can be updated
successfully.
We need to validate the flavor_id, master_flavor, keypair and so on
before patching baymodel.
Closes-Bug: #1555490
Change-Id: I4ae3cd7c0be1161dacb6f0a80c5ee1b53d06d03d
LOG.warn is deprecated. It still used in a few places.
Updated to non-deprecated LOG.warning.
Change-Id: I7e613df8c07616c8cc40a443f3f594407b3555c4
Closes-Bug:#1508442
When creating a bay using heat resources, OS::Magnum::Bay, the first
bay status returns None, then the following bay status returns the
correct CREATE_IN_PROGRESS.
Change-Id: I6e3802b1321de5d300e167c5b0f1a9ebf291fe13
Closes-Bug: #1507598
Someone changed the base class of BayTest to wait bay complete in setUp
method, but TestSwarmAPIs tries to get bay's api_address in setUpClass.
Closes-Bug: #1553042
Change-Id: I7e238dfd18c109ac0e29854a623eceb1b7aa81dd
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
Now, when we create baymodel with the invalid flavor_id and
master_flavor_id parameters, the baymodel can be created
successfully.
We need to validate the flavor_id and master_flavor before
creating baymodel.
Change-Id: Id6768d8246c97d56e529cbc1cab6c8c7d28ca43a
Closed-Bug: #1547345
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>
Add throw exception for the validate code of CSR. Then it
will throw HTTP 400 when the CSR validation is not passed.
Change-Id: I6603a2a243097687fef8666343b993c0a18946a9
Closes-Bug: #1543643
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>
Previously when testing function baymodel, The baymodel
data don't add master_flavor_id data to test
The patch adds the master_flavor_id to baymodel data
funtion test
Change-Id: Ib31f9d9f2214a44fbd620097b7de5ce3ce8a0402
This patch will add tempest logs to bay_client and
test_bay helper methods to provide ability in debugging
gate issues as well as ability to run analysis on logs
Closes-Bug: 1545124
Change-Id: Id5bda1a8776c29ec7cbe2366b3139358811b57c7
This patch will add cert API test for signing and showing
certificates.
The tests for certificates are integrated into test_bay
tests in order to reuse an already existing bay for
cert testing. As a side effect, this patch also
combines update bay test with create, list, and delete
to minimize the time spent waiting on bay create.
Implements: blueprint magnum-tempest
Change-Id: Ifbb4c779376fa401ca2538aba5097f7af8b4973e
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
Updated import order as per the OpenStack import standards [1].
Modules under magnum/common/pythonk8sclient are not covered in
this patch because this code is generated via a third party
tool "swagger-codegen" which does not follows openstack
standards yet.
[1] http://docs.openstack.org/developer/hacking/#import-order-template
Change-Id: Ia87f3e797ee627bf3c04d2bae9639fd305b41b0d
Prevents etcdctl from hanging when etcd has not started by explictly
specifying connection timeouts.
Reduce swarm build time by removing the unneccessary dependency
between masters and nodes.
Only create 1 node instead of 2 nodes
Remove test_update_bay_name_for_existing_bay
Change-Id: If6724497b47247d2858b6da90309949f92314cfb
Closes-Bug: 1541105
The node object represents either a bare metal or virtual machine
node that is provisioned with an OS to run the containers, or
alternatively, run kubernetes. Magnum use Heat to deploy the nodes,
so it is unnecessary to maintain node object in Magnum. Heat can do
the work for us. The code about node object is useless now, so let's
remove it from Magnum.
Closes-Bug: #1540790
Change-Id: If8761b06a364127683099afb4dc51ea551be6f89
To be able to use the functional tests outside of devstack, this
adds a configurtion option to bypass the service catalog and disables
checking SSL certificates during testing.
Change-Id: I56d7403e268074ddb167f6ae8dac8b86b77eb1aa
Partially-Implements: blueprint magnum-tempest
This patch https://review.openstack.org/#/c/266420/ disallowed
baymodel-update when it is referenced by bay(s).
For regression, add to have func test coverage for that.
Change-Id: I4db767da900e48af0234bded3aaf371557c0bfcd
Closes-Bug: #1533746
Replaced iter.next() with next(iter)
Replaced __builtin__ with six.moves.builtin
Replaced unicode with six.text_type
Repleaced Configparser with six.moves.configparser
Blueprint magnum-python3
Change-Id: I9f084ef4fae1ec1111e26142e2e89bad18acbf45
Instead of allowing any volume_driver value to be accepted by the
baymodel API. When creating baymodel, the patch can limit the
volume_driver value for the different coe.
Kubernetes <=> volume_driver = "cinder"
Swarm <=> volume_driver = "rexray"
Mesos <=> volume_driver = "rexray"
Co-Authored By: Kai Qiang Wu(Kennan)<wkqwu@cn.ibm.com>
Co-Authored By: Ton Ngo<ton@us.ibm.com>
Partially-Implements: blueprint magnum-integrate-with-cinder
Depends-On: I52c97e2b04ac636ddac611e3677c4ea3972220eb
Change-Id: I25f1cd005a39950c47f31a8b925f664909b79ee3
Instead of getting a DynamicCredentialProvider directly, use the
get_credentials_provider function. This allows for configuration via
TEMPEST_ variables, but the default will still be dynamic credentials.
Only create the default keypair for tests if it doesn't already exist.
Ensure that credentials are freed by calling clear_creds in all cases.
Change-Id: I62ad5ed9fe7c9f6675989df459f92194bb8d67a8
Implements: blueprint magnum-tempest
According to the new document and Hong Bin's opinion,I changed
code 404 to 400 of the classes as follows:
ImageNotFound
OSDistroFieldNotFound
FlavorNotFound
NetworkNotFound,
because they are nonexistent resources.
So these four exceptions will report code 400 in the future
and we should pay attention to it.
Change-Id: I4040340f9605e3ed03af2ec3b965bf2fc54a0d98
Closes-Bug: #1494122
The error is caused by an incorrect teardown order in baymodel tests.
The teardown in super class will delete the credential, so it should
be called after the baymodel is deleted.
Change-Id: I9a022122c309fe6e2e74f744f196a67beec1f884
Closes-Bug: #1534641
After this patch Ie5a7d138cdb8b226686c189ae86f251c0a1329c8 was merged.
Non-admin user do a 'magnum service-list' will raise a 403 exception.
We can enable this test_magnum_service_list_needs_admin now.
Change-Id: Ic2a0b7c72a76e3561e9f36c801f3039971321b5b
Related-Bug: #1520311
After this patch Ic35c411914d81f1521f4b6051497efaf13772b37 is merged.
We can successfully create a bay without name. So we can delete this
unnecessary negative test case.
Change-Id: I98b412727eac6e0ca64a7b9d44f370545e498bf0
Related-Bug: #1532918
This will add magnum bay CRUD tempest tests
The timeout to create bays is set to 10 minutes,
which may need to be tweaked based on how long it
takes to spin up a bay.
Implements: blueprint magnum-tempest
Change-Id: If4a34d7fd317e10b55d5f07bd51ffe37e6d4bc20
Add logs for docker and docker-storage-setup services.
docker-storage-setup uses MIN_DATA_SIZE=2G for Docker volume, so we
cannot use Docker volume less that 2G (realistic 3G, because some
space should be allocatedtd for medata-data)
Related-Bug: #1500062
Change-Id: I7a0c0023c164f890b492035c05efdb5ce32ef9f9
Fix incorrect Docker storage configuration at agent nodes which cause
failure of docker-storage-setup.service. Add Cinder volume to the
master and configure Docker DeviceMapper to use them and set proper
volume sizes for integration tests
Change-Id: I57dfd6174143f8c7563db2920dd4e94b4f3c9883
Related-Bug: #1500062
Switch to using DynamicCredentialProvider, which
provides a unique non-admin user per test case, making
it possible to functional test in parallel.
Change-Id: I6bb5d493bb01d0dd2b4cd092f87f111b13b1fe02
This patch adds functional testing case for mesos bay creation testing.
1. Add gate_hook.sh to set MAGNUM_GUEST_IMAGE_URL to use ubuntu image
2. Modify post_test_hook to use ubuntu image when doing functional
testing
3. Add new tox env entry to do mesos functional testing.
Partially implements: blueprint mesos-functional-testing
Change-Id: I8ee53de4d34aa79d037901e599fc6409a7de2e72
This is a migration step to utilize tempest plugin
system instead of directly calling functional api tests.
This is the approach used by a number of other projects as well
as an approved process by openstack-qa.
The difference in execution is that we will need to execute tempest's
tox instead of our own:
tox -eall-plugin magnum.tests.functional.api.v1 -- --concurrency=1
Implements: blueprint magnum-tempest
Change-Id: Ic3eadae7fb5d88b776f9ded9589ef25279a2e1be
This random error is due to the different swap space at different
test hosts. In particular, there is a provider who provides VMs with
0 swap space, while other providers provide VMs with 8G swap space.
As a result, Magnum jobs failed at VMs with 0 swap space.
This commit reduces memory consumption of Magnum jobs by reducing the
bay node flavor from 2G to 1G. I consider this as a temporary fix.
A permanent fix should be from infra side to make the swap space
consistent across test nodes.
Partial-Bug: #1521237
Change-Id: Ia043fab1f7665f7299e4094634e02c42b43dcce1
This patch adds a copy_logs as the handler with unittest's addOnException,
by doing this, we can get logs for all failed cases instead of copy them
before teardown.
If without any failed case, don't copy logs for saving time.
Partially implements: blueprint swarm-functional-testing
Change-Id: I47725d0d16735f650adf325adcf4194eb70c384d
This patch increases waiting loop time after swarm bay creation finished.
Raise a meaningful exception to indicate ca initial failed.
Closes-Bug: #1521395
Change-Id: I58c94affe3dc07aa43dc8d7a120b0b62e0cdb47a