Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cd5317e
Adding RDS v3 implementation
vineet-pruthi Sep 11, 2019
257caf5
Saving Changes to github
vineet-pruthi Sep 15, 2019
ac1b6b5
Saving further changes in RDSv3
vineet-pruthi Sep 17, 2019
6a8605b
Adding RDSv3 Instance and Backup functionalities
vineet-pruthi Sep 26, 2019
038acbe
Merge remote-tracking branch 'origin' into rds_v3
vineet-pruthi Sep 27, 2019
901a031
Updates in RDS Backup Funcationality
vineet-pruthi Sep 27, 2019
e7f2e52
Saving RDSv3 Changes to GitHub
vineet-pruthi Oct 3, 2019
66b4622
Adding Backup Policy for RDSv3
vineet-pruthi Oct 4, 2019
6f10c6b
Adding RDSv3 restore functionality
vineet-pruthi Oct 4, 2019
f37095f
interim update wrt coding conventions
gtema Oct 7, 2019
a991818
next bunch of changes for instance
gtema Oct 8, 2019
74c6c83
cleanup configurations
gtema Oct 9, 2019
0d177e5
next bunch of changes
gtema Oct 9, 2019
9aff98a
finish implementation, switch to usage tests
gtema Oct 10, 2019
ee310e6
add check for additional mandatory params
gtema Oct 10, 2019
ac9c685
add wait_for_job and replace --datastore with --datatore-type
gtema Oct 10, 2019
77a9c1c
extend params choices for create instance params
gtema Oct 10, 2019
116ac47
fix help message with param names
gtema Oct 10, 2019
e669eea
check flavor when creating instance
gtema Oct 10, 2019
9aac06e
hopefully fix find instance
gtema Oct 10, 2019
40df814
rds is not using default job query
gtema Oct 10, 2019
eabb89e
try to improve find_flavor
gtema Oct 10, 2019
a93c7dc
add some checks for ha_mode <=> datastore_type
gtema Oct 10, 2019
bd14eca
add tests for ensuring mode vs datastore checks
gtema Oct 10, 2019
99670ff
fix pep
gtema Oct 10, 2019
e57a690
add wait for deleting instance
gtema Oct 10, 2019
90e19d8
add optional wait-interval argument
gtema Oct 10, 2019
c9ecafe
try fix wait_for_job for rds
gtema Oct 10, 2019
a6dd96f
add basic get_instance as mix of list and fetch
gtema Oct 10, 2019
e1420d0
extend unit test for instance.fetch
gtema Oct 10, 2019
43fc694
fix error param
gtema Oct 10, 2019
95be4c6
skip extra list conversion
gtema Oct 10, 2019
5196ef1
raise exception if --wait-interval is without --wait
gtema Oct 10, 2019
0e3cb79
override _translate_response of instance to process create response r…
gtema Oct 10, 2019
c8731f2
Minor Fix in setup.cfg
vineet-pruthi Oct 11, 2019
3656ffb
fix configuration and add func test
gtema Oct 11, 2019
1ca2be1
add some choices to instance list
gtema Oct 11, 2019
986d673
Adding few more rds test_config func tests
vineet-pruthi Oct 11, 2019
a1561bf
try fix pagination
gtema Oct 11, 2019
6a61009
another try for pagination
gtema Oct 11, 2019
517baae
fix
gtema Oct 11, 2019
12922d1
if limit set - return only this amount of entries
gtema Oct 11, 2019
ca650af
some reorg
gtema Oct 11, 2019
ef49205
turn back dropped refetch
gtema Oct 11, 2019
0bcdc29
try fix download-links
gtema Oct 11, 2019
dbf69f2
change help to show only backup_id is accepted
gtema Oct 11, 2019
7bda70a
Updated formatting for test_configuration
vineet-pruthi Oct 11, 2019
09c3466
fix download links
gtema Oct 11, 2019
71256e6
change apply config
gtema Oct 11, 2019
e91edcb
change apply
gtema Oct 11, 2019
58871a7
fix set backup policy
gtema Oct 11, 2019
c047e2a
rename fields
gtema Oct 11, 2019
222a24c
some fixes in list backup
gtema Oct 11, 2019
34c273f
change params from "_" to "-"
gtema Oct 11, 2019
228943f
exclude time filters in listing backups due to API corruptness
gtema Oct 11, 2019
33ae07c
add KB to the download size header
gtema Oct 11, 2019
e57dfc4
parse backup struct better
gtema Oct 11, 2019
240effd
fix create struct
gtema Oct 11, 2019
5ba785e
hide lcoation of backup
gtema Oct 11, 2019
98b6e2f
restore required params
gtema Oct 11, 2019
e327597
enable show restore time
gtema Oct 11, 2019
1606a58
Sync branch 'master' into rds_v3
gtema Oct 14, 2019
a812af5
Adding functional tests for osclient
vineet-pruthi Oct 15, 2019
49cde7c
Merge remote-tracking branch 'master' into rds_v3
vineet-pruthi Oct 29, 2019
1aec306
Updated functional tests for rdsv3
vineet-pruthi Nov 6, 2019
714a526
Merge remote-tracking branch 'origin' into rds_v3
vineet-pruthi Nov 6, 2019
1a28efd
Merge branch 'master' into rds_v3
vineet-pruthi Nov 14, 2019
332b756
Saving functional tests for rds instance
vineet-pruthi Nov 18, 2019
c47b187
pep8 fixes
vineet-pruthi Dec 10, 2019
d1b1aa6
removed print line
vineet-pruthi Dec 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 70 additions & 100 deletions otcextensions/tests/functional/osclient/rds/v3/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,133 +11,96 @@
# under the License.

import json
import uuid
import random

from openstackclient.tests.functional import base


class TestRdsConfiguration(base.TestCase):
"""Functional tests for RDS Configurations. """

NAME = uuid.uuid4().hex

def test_list(self):
json_output = json.loads(
self.openstack('rds configuration list -f json '))
json_output = json.loads(self.openstack(
'rds configuration list -f json '
))
self.assertIsNotNone(json_output)

def test_show(self):
json_output = json.loads(
self.openstack('rds configuration list -f json'))

json_output = json.loads(
self.openstack(
'rds configuration show {cfg} '
'-f json'.format(
cfg=json_output[0]['ID']
)
)
)
json_output = json.loads(self.openstack(
'rds configuration list -f json'
))

self.assertIsNotNone(json_output['id'])
json_output = json.loads(self.openstack(
'rds configuration show {cfg} -f json'.format(
cfg=json_output[0]['ID'])
))

def test_long(self):
json_output = json.loads(
self.openstack(
'rds configuration create '
'--datastore-type postgresql '
'--datastore-version 9.6 '
'--value max_connections=10 '
'{name} -f json'.format(name=self.NAME)
)
)
id = json_output['id']
self.addCleanup(self.openstack, 'rds configuration delete ' + id)

json_output = json.loads(
self.openstack(
'rds configuration show {id} '
'-f json'.format(id=id)
)
)
self.assertTrue(self.NAME, json_output['name'])
self.assertIsNotNone(json_output['id'])

json_output = json.loads(
self.openstack(
'rds configuration show {id} '
'-f json'.format(id=self.NAME)
)
)
self.assertTrue(id, json_output['id'])
def test_create(self):
name = 'osc-test-config-' + format(random.randint(1, 2**16), '04x')
json_output = json.loads(self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'-f json'.format(
name=name)
))
self.assertIsNotNone(json_output)

self.openstack(
'rds configuration set '
'--value max_connections=15 '
'{name}'.format(name=self.NAME)
'rds configuration delete '
'{name} '.format(
name=name)
)
self.assertTrue(True)

def test_create(self):
name = uuid.uuid4().hex
json_output = json.loads(
self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'-f json'.format(name=name)
)
)
def test_create_with_value(self):
name = 'osc-test-config-' + format(random.randint(1, 2**16), '04x')
json_output = json.loads(self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'--value max_connections=10 '
'--value autocommit=OFF '
'-f json'.format(
name=name)
))
self.assertIsNotNone(json_output)
id = json_output['id']
self.addCleanup(self.openstack, 'rds configuration delete ' + id)

def test_create_with_value(self):
name = uuid.uuid4().hex
json_output = json.loads(
self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'--value max_connections=10 '
'--value autocommit=OFF '
'-f json'.format(name=name)
)
self.openstack(
'rds configuration delete '
'{name} '.format(
name=name)
)
self.assertIsNotNone(json_output)
self.assertEqual(name, json_output['name'])
id = json_output['id']
self.addCleanup(self.openstack, 'rds configuration delete ' + id)
self.assertTrue(True)

def test_config_param_list(self):
json_output = json.loads(
self.openstack(
'rds configuration list -f json'
)
)
json_output = json.loads(
self.openstack(
'rds configuration parameter list '
'{cfg} '
'-f json'.format(cfg=json_output[0]['ID'])
)
)
json_output = json.loads(self.openstack(
'rds configuration list -f json'
))

json_output = json.loads(self.openstack(
'rds configuration parameter list '
'{cfg} '
'-f json'.format(
cfg=json_output[0]['ID'])
))
self.assertIsNotNone(json_output)

def test_config_set(self):
name = uuid.uuid4().hex
json_output = json.loads(
self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'-f json'.format(name=name)
)
)
name = 'osc-test-config-' + format(random.randint(1, 2**16), '04x')
json_output = json.loads(self.openstack(
'rds configuration create '
'{name} '
'--datastore-type MySQL '
'--datastore-version 5.7 '
'-f json'.format(
name=name)
))
self.assertIsNotNone(json_output)
id = json_output['id']
self.addCleanup(self.openstack, 'rds configuration delete ' + id)

self.openstack(
'rds configuration set '
Expand All @@ -146,3 +109,10 @@ def test_config_set(self):
'--value autocommit=OFF'.format(name=name)
)
self.assertTrue(True)

self.openstack(
'rds configuration delete '
'{name} '.format(
name=name)
)
self.assertTrue(True)
29 changes: 23 additions & 6 deletions otcextensions/tests/functional/osclient/rds/v3/test_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json

from openstackclient.tests.functional import base
from tempest.lib import exceptions


class TestRdsDatastore(base.TestCase):
Expand All @@ -22,14 +23,30 @@ def test_datastore_list(self):
json_output = json.loads(self.openstack(
'rds datastore type list -f json '
))
self.assertIn(
'PostgreSQL',
[ds['Name'] for ds in json_output]

self.assertItemsEqual(
['postgresql', 'mysql', 'sqlserver'],
[ds.get('Name', None).lower() for ds in json_output]
)

def test_datastore_version_list(self):
json_output = json.loads(self.openstack(
'rds datastore version list PostgreSQL -f json'
datastores = json.loads(self.openstack(
'rds datastore type list -f json'
))
for datastore in datastores:
json_output = json.loads(self.openstack(
'rds datastore version list {ds} '
'-f json'.format(ds=datastore['Name'])
))
self.assertIsNotNone(json_output)
self.assertEqual(
['ID', 'Name'],
list(json_output[0].keys())
)

self.assertIsNotNone(json_output)
def test_invalid_datastore_version_list(self):
self.assertRaises(
exceptions.CommandFailed,
self.openstack,
'rds datastore version list invalid_ds'
)
53 changes: 45 additions & 8 deletions otcextensions/tests/functional/osclient/rds/v3/test_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import uuid

from openstackclient.tests.functional import base
from tempest.lib import exceptions


class TestRdsFlavor(base.TestCase):
Expand All @@ -23,14 +24,50 @@ class TestRdsFlavor(base.TestCase):
OTHER_NAME = uuid.uuid4().hex

def test_flavor_list(self):
json_output = json.loads(self.openstack(
'rds datastore version list postgresql -f json '
datastores = json.loads(self.openstack(
'rds datastore type list -f json'
))
ver = json_output[0]['Name']
for datastore in datastores:
datastore = datastore['Name']
json_output = json.loads(self.openstack(
'rds datastore version list ' + datastore + ' -f json '
))

json_output = json.loads(self.openstack(
'rds flavor list postgresql {ver} -f json '.format(
ver=ver)
))
for ds_ver in json_output:
json_output = json.loads(self.openstack(
'rds flavor list {ds} {ver} -f json'.format(
ds=datastore,
ver=ds_ver['Name'])
))

self.assertIsNotNone(json_output)
self.assertEqual(
['name', 'instance_mode', 'vcpus', 'ram'],
list(json_output[0].keys())
)

def test_invalid_datastore_flavor_list(self):
self.assertRaises(
exceptions.CommandFailed,
self.openstack,
'rds flavor list'
)

self.assertIsNotNone(json_output)
self.assertRaises(
exceptions.CommandFailed,
self.openstack,
'rds flavor list invalid_ds 5.6'
)

datastores = json.loads(self.openstack(
'rds datastore type list -f json'
))
for datastore in datastores:
datastore = datastore['Name']
self.assertRaises(
exceptions.CommandFailed,
self.openstack,
'rds flavor list {ds} {ver}'.format(
ds=datastore,
ver=0.0)
)
Loading