Commit Graph

45 Commits

Author SHA1 Message Date
wu.chunyang 93f35c7f04 Get rid of nose and Proboscis
they are not maintained for a long time, and trove already switch
the tests to templest.
This commit removes the usage of them. more details see story.

Story: 2010882
Task: 48606

Depends-On: https://review.opendev.org/c/openstack/trove/+/914228

Change-Id: Ie021e0bd708cf8ed13853dea632312af38190205
2024-03-28 07:07:15 +00:00
Lingxian Kong c4fd9cbe34 Fix functional test for instance access operation
Change-Id: I8557782dc80b9bc691268bc96d3188bf55cdd86d
2020-08-12 18:25:31 +12:00
Lingxian Kong cf3e9a6e74 Support to rebuild instance by admin
Change-Id: I48f8c6f997daeb6d82ff62b3325277d86fee2147
2020-08-06 20:38:11 +12:00
Lingxian Kong efb6a811be Using same config with primary for replicas
Change-Id: Icadc95ea54e4509dc148f8e84f2eaac5840509f3
2020-07-27 09:28:17 +12:00
Lingxian Kong aa1d4d2246 Datastore containerization
Significant changes:

* Using docker image to install datastore.
* Datastore image is common to different datastores.
* Using backup docker image to do backup and restore.
* Support MariaDB replication
* Set most of the functional jobs as non-voting as nested
  virtualization is not supported in CI.

Change-Id: Ia9c97a63a961eebc336b70d28dc77638144c1834
2020-05-27 10:31:50 +12:00
Lingxian Kong 602c4d42de Improve the function tests
- Execute test groups in serial to make sure no more than 2 database
  instance are created at the same time.
- Remove some unneccesary tests
- Remove unneeded datastore, e.g. 'Test_Datastore_1'
- Remove unsupported trovestack subcommands
- Move unsupported DIB elements to the 'deprecated-elements' folder
- Decrease default value of 'agent_call_high_timeout' to 5min
- Add initial_deplay for pooling task
- Use socket file to connect with database instead of using localhost
  IP

Change-Id: Ie5030a671fbeb453eafa6cbe04e08da7b52e33c9
2020-01-28 14:27:52 +13:00
Lingxian Kong a0a10f0b94 Support HEALTHY status for db instance
- 'HEALTHY' means the db service is responsive, 'ACTIVE' means the db
  service is alive.
- Remove the CI job fakemodetests, but will add similar testing task in
  the future.
- Fix the periodic CI job
- Remove MongoDB and  related jobs

Change-Id: I5abe9091ba203297dc87db5fba139179166321f7
2019-12-14 12:55:56 +13:00
Lingxian Kong 2e052b0262 Enable service tenant deployment model by default in DevStack
The service tenant deployment model means Trove creates most of the
resources(vm, volume, security group, etc.) relating to a database
instance in the Trove service tenant rather than the end user.

With this deployment model, most of the related resources behind the
scenes are invisible to the user, which is a more secure deployment
model for either private or public cloud provider.

DevStack should follow this model as it will be recommended for Trove
deployment in production.

Changes included in this patch that are necessary in order to make that
happen:

- Add 'admin' role to Trove service user(username: trove, project:
  service) in DevStack.
- Create Trove management network resources for Trove service user in
  DevStack.
- Enable Trove remote client configuration by default in DevStack.
- Mainly use alt_demo user in alt_demo project for integration tests,
  config trove user as the admin role user in integration tests.
- Disable the module related tests(module_groups) for now because of no
  use cases but need effort to fix all the failed tests in the service
  tenant model.

Story: #2005445
Task: #30489
Change-Id: I2efb69d3d50344914a875b773f62a227dba2ccaf
2019-06-08 00:46:21 +12:00
Lingxian Kong 6ea816312e Fix tests for Ubuntu Bionic migration of CI jobs
Change-Id: I2fee668c3774f7e87ce3478ca998f8b366c6cd41
2019-03-28 10:32:26 +00:00
Zuul a0245ce535 Merge "Add image setup to trove devstack plugin" 2019-01-16 20:44:17 +00:00
Dariusz Krol 68a4819dd4 Add image setup to trove devstack plugin
Main goal is to have a working vm image registered in
trove after devstack installation.

It is a first step towards trovestack-redesign as described
in https://etherpad.openstack.org/p/trovestack-redesign

It is enabled by default during devstack installation with
trove enabled plugin, but it can be skipped by setting
DISABLE_TROVE_IMAGE_SETUP=TRUE

Implementation details:
* export environmental variables for diskimage-builder
* build an image with disk-image-create script
* register the newly created image in trove
* add tripleo-elements information to default settings

Change-Id: I6e57890c5b6fb65e9b8c63363f92e5a7c70e523e
Signed-off-by: Dariusz Krol <d.krol@samsung.com>
2018-12-14 21:26:01 +01:00
Marcin Piwowarczyk e9cc6ca372 Execute functional test jobs running under python3
Functional tests are executed by trovestack script, which uses python
in default OS version which is 2.7.

This change wraps python in tox and executes trovestack int_tests in
virtual enviroment, starting them in python3.

Any future python version change could be managed by tox framework.

Change-Id: I3a849978241d3d0669ef9e1c802ff504ac3c32cb
Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
2018-12-14 13:07:13 +01:00
wangyao 8e2bb674c4 Add volume size verify for replica based on master
According bug description, replica should has volume size at least
as much as the master. Otherwise it maybe cause exception for
replica data. To solve this problem,I added judgement for volume
size when create a replica, which not smaller than master
volume size. And make this function as configurable by
CONF.verify_replica_volume_size.
Also provide a test case to validate the method.

Change-Id: I5e110ce672c1b1715bca1727d70d656301cd0d43
Closes-Bug: #1357500
2017-11-13 23:33:45 +08:00
Peter Stachowski d54cd03199 (fix troveclient gate) Use alt-demo network
This change uses the alt-demo network instead of sharing
the private network from the demo tenant.  This should
fix the tempest tests on python-troveclient complaining
about this and also brings us one step closer to using
neutron entirely.

Tested with the demo tenant as well and it still
puts on a network without using the --nic parameter, the
only drawback is that the ip doesn't appear on the trove
show command.

The scenario and api tests were modified to always pass
in the nic parameter (as it probably should have been done
from the beginning anyways).

Change-Id: I9f3cbae3490e9995ba5f835fc2304442b83464e4
Closes-Bug: 1647001
2016-12-03 01:12:11 +00:00
Peter Stachowski e89dfbd51d Skip 'eject valid master' replication test
This test was skipped in the scenario runs however it was
not disabled in the original api tests.  Although it
doesn't fail as often there it still happens, so the
same change has been applied to it.

See: https://review.openstack.org/#/c/368230

The test will also print out the bug number during each run
as a reminder (using the new SkipKnownBug method).

Change-Id: I931d6d72a70cc93dcd8248d9840eadf1160b9bab
Related-Bug: #1622014
2016-09-21 15:38:10 +00:00
Peter Stachowski e36c1ca58b Fix replication scenario tests
When the change for slave_of -> replica_of was reverted, the
test calls using the python interface (int-tests) were also
reverted.  Unfortunately the scenario tests were not, so they
are now broken.

This fix synchronizes the calls to all use replica_of, which is
the preferred argument.

Closes-Bug: #1558584
Change-Id: I45c8c5a21c141ee7ebd8b5616bac174fe99eb907
2016-03-18 18:37:15 +00:00
Matt Riedemann cc18985814 Revert "Time to get rid of most vestiges of slave_of"
This reverts commit 0c94a5bae0

Removing 'slave_of' from the instance create API was a
backward incompatible change.

The parameter should be removed if/when trove has a new
version in their API, or adopts microversions.

This change depends on the change which reverts the
removal of slave_of from python-troveclient since
the tests depend on that argument being available in the
client.

Note that the tests could later be updated to no longer
use 'slave_of' to avoid a deprecation warning from the
client.

Conflicts:
        trove/tests/api/replication.py

NOTE(mriedem): The conflict was due to
5515c5291c.

Depends-On: I9b3ec6c101a89f30e61fc683808506c404e5474f

Change-Id: Ib6811293d99fbc20f6a52ee10de7c98bfb682b18
Partial-Bug: #1538506
2016-03-09 16:47:35 -05:00
Luigi Toscano 5515c5291c Pass datastore details when required (again)
This is another set of fixes to integration tests, as the datastore is not
inherited by the parent job when a backup or a replica is created.

See also:
- Ib3e78bb68aaf992177b9d9cd1d89e84fb54830ed
- Ice626b3d3f73e75222b1080afa58232e03459a8e

Also, fix the fake guestagent so that it works with the increased
timing coming from the fixed (now working) tests.

Change-Id: I8d2b5a4627eb9292ba4535696f9565a3c20a0783
2016-02-23 17:21:11 +01:00
Amrith Kumar a0f8ed952d Revert Skiptest from change set 245845
Change set 245845 skipped two tests to break the deadly embrace
between the client and the controller. This change reverts that.

Change-Id: I7f81a7ed579694abaeb15be01ca54720f8a73810
Partial-Bug: #1461196
Depends-On: I9b905716b704ea9ec9332b48b05c49cccbd04c8b
Depends-On: I87c8a14c06fa5df60ea3ed6b09412dc32fafcec7
2016-01-15 18:01:54 +00:00
Amrith Kumar 0c94a5bae0 Time to get rid of most vestiges of slave_of
Commit https://review.openstack.org/#/c/245738/ eliminated slave_of in
the python-troveclient. The controller has long understood how to deal
with replica_of but there are a couple of tests that are still sending
in slave_of.

This commit removes slave_of from the tests and from the Trove public
API. The python-troveclient commit will depend on this commit as the
DSVM test(s) which are in the trove repository currently fail in that
change.

This commit also contains a change to tests/api/replication.py and
disables the test 'test_detach_replica' and
test_slave_is_not_read_only with a distinct SkipTest. This is to break
the deadly embrace between this change set and the related changeset
on the client side as circular dependencies across projects are not
allowed.

Change-Id: I87c8a14c06fa5df60ea3ed6b09412dc32fafcec7
Partial-Bug: #1461196
Related: I9b905716b704ea9ec9332b48b05c49cccbd04c8b
2016-01-15 09:40:10 -05:00
Jenkins 96cbf434db Merge "Use a specific network for the test" 2016-01-08 12:21:04 +00:00
Jenkins f58b12e776 Merge "Fix race condition in replication backup delete" 2016-01-07 01:41:41 +00:00
Luigi Toscano b857d1709e Use a specific network for the test
If integration tests are executed in an environment with multiple nics,
nova complains and the instance does not start. Given that the
shared_network parameter is already available with that specific
meaning, use it on instance creation.
The default value (None) should ensure that the default behavior
does not change.

Change-Id: I8554ebf111cad829deb34d3d23d18f72d7f13554
2015-12-15 01:42:29 +01:00
Luigi Toscano 0be181013a Use configured datastore on instance creation
The datastore and its version is now always passed on instance creation for
integration tests.
Previously the default datastore (and version) were used, ignoring the
settings in the test configuration.

Change-Id: Ib3e78bb68aaf992177b9d9cd1d89e84fb54830ed
Depends-On: Ifa4496eb1c9e2fe053978c708e7fa1069f12cb3f
2015-12-10 01:46:27 +01:00
Peter Stachowski 5c4c924b50 Fix race condition in replication backup delete
In the int-tests, the replication implementation verifies that the
backup used to create the replica is removed after the slave goes
active. This test runs right after the slave create, so on occasion
the backup still exists when the test runs, since the taskmanager
doesn't delete it until it also receives word that the instance is
up and running.

The test was modified to wait until the backup is gone.

The replication scenario test was also modified to include this
check at the end of its run.

Closes-Bug: #1518477
Change-Id: If815f496d6bf9111dd1f04bf02f61207a2317b2b
2015-11-24 16:10:23 +00:00
Sushil Kumar 843bb0cd53 Fixes hacking rules
This patchset helps reducing the ignored pep8 errors.

Fixed some ignored hacking rules, as listed follows:
- E111 indentation is not a multiple of four
- E122 continuation line missing indentation or outdented
- E123 closing bracket does not match indentation of opening bracket's line
- E128 continuation line under-indented for visual indent
- E251 unexpected spaces around keyword / parameter equals
- E265 block comment should start with '# '
- E713 test for membership should be 'not in'
- H105  Don't use author tags
- H306  imports not in alphabetical order

Change-Id: Iadf2af4f6ec90420153ad63b5a41650392ef2cbd
2015-05-29 07:27:59 +00:00
Jenkins d7d4882784 Merge "Fix replica source state validation" 2015-04-04 07:52:53 +00:00
Matt Van Dijk 32387f8ffd Fix replica source state validation
Creating a replica did not check that the specified source was available.
It is necessary that the source's state is active and that it is not busy.
This is done by verifying the state and status of the master.

The new checks will throw a HTTP 422 UnprocessableEntity in cases when the
status is not ACTIVE or source is busy performing a task

Changes:
 - adding validation step that checks if master exists and in proper state.
 - added appropriate API and unit tests

Co-authored by: Denis Makogon <dmakogon@mirantis.com>

DocImpact

Change-Id: Ib4e37ff0036998bc53058e400054ed93fcc2e144
Closes-Bug: #1357704
2015-03-27 14:04:28 +00:00
Morgan Jones d67997f251 Replication V2
The V2 implentation of replication, including:
  - Ubuntu 14.04
  - Mysql 5.6
  - GTID Replication Strategy
  - promote-to-replica-source
  - eject-replica-source
  - --replica_count option to create
  - replica creation from incremental backups

By agreement with Slicknik (Trove PTL), the following
exclusions from the spec have been made:
  - slave promoted to master by eject not replaced
  - slave promoted by eject chosen by txn count
    rather than most recent txn

Authored-By: Morgan Jones <morgan@parelastic.com>
Co-Authored-By: Peter Stachowski <peter@tesora.com>
Co-Authored-By: Doug Shelley <doug@parelastic.com>
Co-Authored-By: Duk Loi <duk@tesora.com>
Co-Authored-By: Petr Malik <pmalik@tesora.com>

Change-Id: I7f921b75e66081cac9ec5a60fb204d61162e9a12
Depends-On: I8eec708f41e791e3db04a2c7b7c12855118b64ac
Depends-On: I9075365a8fae754e29d27d6e371a1d8c8980e26b
Implements: blueprint replication-v2
2015-03-18 14:49:57 -04:00
Jenkins 80dde965f0 Merge "Fix timeout in test_slave_user_removed int-test" 2014-12-08 21:41:43 +00:00
Nikhil Manchanda 6c75647f0e Fix timeout in test_slave_user_removed int-test
The test_slave_user_removed int-test polls to check that the
slave user account is removed, but doesn't currently have a time
out set. This means that a failure in this test causes the entire
suite to spin, and ultimately time out. Fix this by adding a 3 min
timeout to this test.

Change-Id: I5f869c7d3cb0587409b5a12a89ed673e57552b82
Closes-bug: 1399583
2014-12-05 01:42:22 -08:00
Jenkins 025355709a Merge "Poll for replica read_only status in test" 2014-12-03 02:47:08 +00:00
Nikhil Manchanda 500613e68f Ensure Replication Tests do not use a stale token
Fixed the replication tests to re-authenticate the common test dbaas
client in order to ensure that we do not use a stale auth_token when
running the replication tests.

Change-Id: I37a2a4b7dca056e84b48c66cbe3b8c8fb6a2f1db
Closes-bug: 1394831
2014-11-20 19:03:27 -08:00
ridhi.j.shah@gmail.com 5c66bbc34b Poll for replica read_only status in test
There is a time lag for the read_only system variable in the
detached replica to change from true to false, causing the test
to fail many times.Make the test_slave_is_not_read_only
poll unitl the value changes.

Change-Id: I6191cb7f85e18b30a16383675490a6186185ba5b
Closes-Bug: #1393914
2014-11-18 13:52:18 -06:00
Morgan Jones e5c757f3ee Use unique passwords for replication user
Generates a unique user with a random password for each slave.
The replication user and password is passed to each slave during
the snapshot attach process.  Replication user is deleted from
both the master and the slave during the detach process.

Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>
Co-Authored-By: Denis Makogon <dmakogon@mirantis.com>

Change-Id: I9cb158a161714bfff90225227f5c652120393ba7
Closes-bug: 1357065
2014-10-01 14:57:35 +03:00
Iccha Sethi c313948531 Mandate detach replicas before deleting replica source
If the user attempts to delete an instance which has
replicas attached to it, forbid the delete.

Closes bug: #1362299

Change-Id: I644243aef74d9a34b7726139f9fa5ca8bdb1452c
2014-09-29 11:38:28 -05:00
Jenkins d511338da5 Merge "Delete backup created during replication" 2014-09-23 07:43:39 +00:00
Iccha Sethi 00b2b61bd5 Delete backup created during replication
During replication, backup of the master instance is
taken, and a slave is created using this backup.
This patch cleans up the backup which is created
during this process (irrespective of whether it was
successfully provisioned or not).

Closes-Bug: #1359354
Change-Id: Ic636ffeb0bbfb9e6cc02690efe812ffc11bda85c
2014-09-16 13:34:49 +00:00
Morgan Jones b4250c05f9 Marks mysql slave read-only
When a slave is attached to a master site, this change will
mark the slave site as read-only to prevent the slave site
from being updated by users.  Only users with root privileges
or slave priveleges will be able to update the database.

Change-Id: Idb6c54b85a23af9a468ff9d62b3110fa72ff7da0
Closes-bug: #1359392
2014-09-09 11:18:33 -07:00
Greg Lucas 661dbd4ef1 Add detach-replica support
Add a PATCH route to unset the slave_of property on an instance, i.e. to
detach a replica from its replication source.

Rename existing 'detach_replication_slave' functions to 'detach_replica'
to be consistent with the python-troveclient.

Add test case to tests/api/replication.py.

Partially Implements: blueprint replication-v1

Change-Id: I3596a3b76cc484b42db38f02e51c028d5ff2ed6c
2014-09-02 14:03:47 -04:00
Nikhil Manchanda 53f79f6255 Use 'replica' instead of 'slave'
The term 'slave' is very mysql specific. Deprecate the API terminology
that references 'slaves', and 'slave_of', and replace it with 'replicas',
and 'replica_of' instead which is more applicable across datastores of
different types.

Co-Authored-By: Greg Lucas <glucas@tesora.com>
Change-Id: Ief4bc83369fa3183a321d3e07b69b1801595ab15
Closes-bug: 1360310
2014-09-01 11:26:26 -07:00
Jenkins 12eb9c2db2 Merge "Add replication slave info to instance show" 2014-08-27 10:33:38 +00:00
Greg Lucas 87b621b2d9 Add replication slave info to instance show
Update the 'show' response for an instance:

 - If the instance is a replication slave, include the slave_of id.
 - If the instance is a replication master, include the list of slave
   instance ids.

Update the 'list' response to include the slave_of id.
Add CheckInstance tests for slave/slave_of info.

(Unrelated: remove a #TODO comment that has already been addressed.)

Partially Implements: blueprint replication-v1
Closes-Bug: #1340359
Change-Id: If8a154083d0095606fb3ee115cc9b66ab788cbb4
2014-08-25 10:11:01 -04:00
Morgan Jones 1c23f89601 Snapshot component for replication
Implements the snapshot capability for replication by
taking a backup of the master site, then using it
to populate the slave, then turning on replication.

Co-Authored-By: Greg Lucas <glucas@tesora.com>
Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>

Partially implements: blueprint replication-v1
Change-Id: Ibd3214b2ffafb250f0cc794c6ee0ff6b0d2ed7da
2014-08-24 11:31:57 -07:00
Morgan Jones 86eacbeabc Mysql guest agent functionality for replication
Implement new strategy for replication
Implement replication strategy for mysql binlog replication.
Supporting methods in mysql service
Implement API methods in mysql manager
Define configuration settings for replication

Co-authored by: Nikhil Manchanda <SlickNik@gmail.com>
Co-authored by: Greg Lucas <glucas@tesora.com>

Partially implements: blueprint replication-v1
Change-Id: I70f0b5c37fe3c2d42426029bb627c141965eb524
2014-08-14 17:25:42 -07:00