Skip to content

Commit

Permalink
[tests] Add avocado tests for openstack plugins
Browse files Browse the repository at this point in the history
Inititally doing for the most common ones

Signed-off-by: Arif Ali <arif.ali@canonical.com>
  • Loading branch information
arif-ali committed May 6, 2024
1 parent 5eef057 commit d683bd2
Show file tree
Hide file tree
Showing 10 changed files with 790 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ report_stagetwo_task:
dnf -y install python3-pexpect
fi
main_script: &stagetwo_test |
PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stagetwo tests/{cleaner,collect,report,vendor}_tests
PYTHONPATH=tests/:. avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stagetwo tests/{cleaner,collect,report,vendor}_tests
on_failure:
fail_script: *faillogs
log_artifacts: *logs
Expand Down
1 change: 1 addition & 0 deletions sos/report/plugins/openstack_keystone.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def setup(self):
"/etc/keystone/keystone.conf",
"/etc/keystone/logging.conf",
"/etc/keystone/policy.json",
"/etc/keystone/keystone.policy.yaml",
self.var_puppet_gen + "/etc/keystone/*.conf",
self.var_puppet_gen + "/etc/keystone/*.json",
self.var_puppet_gen + "/etc/httpd/conf/",
Expand Down
114 changes: 114 additions & 0 deletions tests/report_tests/plugin_tests/openstack/cinder.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
verbose = True
debug = True
use_syslog = False
auth_strategy = keystone
state_path = /var/lib/cinder
osapi_volume_workers = 2


transport_url = rabbit://cinder:cmB4zBYq3VWFMNqNKFLcqS5Zq8ystLLsTd5BFLbCtX67qShnhgHFxxRFjkhbY54x@10.5.0.95:5672/openstack




osapi_volume_listen = 0.0.0.0
osapi_volume_listen_port = 8756
glance_api_servers = https://10.5.0.29:9292
glance_api_version = 2
os_region_name = RegionOne
volume_usage_audit_period = month

cinder_internal_tenant_project_id = services
cinder_internal_tenant_user_id = cinderv2_cinderv3


enabled_backends = LVM


[backend_defaults]






[keystone_authtoken]
auth_type = password
auth_uri = https://10.5.2.40:5000/v3
auth_url = https://10.5.2.40:35357/v3
project_domain_name = service_domain
user_domain_name = service_domain
service_type = volumev2
project_name = services
username = cinderv2_cinderv3
password = wPhFqY69x94YVJc7STrVH3CfsFrrcZPYw8NS2pjhzqyzw7wrL2VnTmN58c5XTnfV
signing_dir = /var/cache/cinder

memcached_servers = inet6:[::1]:11211
service_token_roles = Admin
service_token_roles_required = True



[service_user]
send_service_user_token = true
auth_type = password
auth_url = https://10.5.2.40:35357
project_domain_name = service_domain
user_domain_name = service_domain
project_name = services
username = cinderv2_cinderv3
password = wPhFqY69x94YVJc7STrVH3CfsFrrcZPYw8NS2pjhzqyzw7wrL2VnTmN58c5XTnfV

[database]
connection = mysql+pymysql://cinder:Ck3r7zf6B6PscfjWhhj2zJdy8SNXYd59@127.0.0.1/cinder


[oslo_messaging_rabbit]


[oslo_messaging_notifications]
driver = messagingv2
transport_url = rabbit://cinder:cmB4zBYq3VWFMNqNKFLcqS5Zq8ystLLsTd5BFLbCtX67qShnhgHFxxRFjkhbY54x@10.5.0.95:5672/openstack



[oslo_concurrency]
lock_path = /var/lock/cinder

[keymgr]
# XXX: hack to work around http://pad.lv/1516085
# will be superseded by SRU to cinder package
encryption_auth_url = https://10.5.2.40:5000/v3

[oslo_middleware]

# Bug #1758675
enable_proxy_headers_parsing = true


[nova]
# Authentication type to load (string value)
auth_type = password

# Authentication URL (string value)
auth_url = https://10.5.2.40:35357

# Username (string value)
username = cinderv2_cinderv3

# User's password (string value)
password = wPhFqY69x94YVJc7STrVH3CfsFrrcZPYw8NS2pjhzqyzw7wrL2VnTmN58c5XTnfV

# Project name to scope to (string value)
project_name = services


project_domain_name = service_domain
user_domain_name = service_domain
region_name = RegionOne

86 changes: 86 additions & 0 deletions tests/report_tests/plugin_tests/openstack/glance-api.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[DEFAULT]
verbose = True
use_syslog = False
debug = True
workers = 2
bind_host = 0.0.0.0

bind_port = 9272

transport_url = rabbit://glance:4LzVZZLsPTrKw7c49ZdxqmJ8mkcWkSSnPJzgYyZWPMkrVzyB62CyCzzKVRnBS4Mz@10.5.0.95:5672/openstack


log_file = /var/log/glance/api.log
backlog = 4096

delayed_delete = False
scrub_time = 43200
scrubber_datadir = /var/lib/glance/scrubber
image_cache_dir = /var/lib/glance/image-cache/
db_enforce_mysql_charset = False

image_size_cap = 1099511627776

enabled_backends = local:file


[glance_store]

default_backend = local


filesystem_store_datadir = /var/lib/glance/images/

stores = glance.store.filesystem.Store,glance.store.http.Store
default_store = file
[image_format]
disk_formats = ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,root-tar
[keystone_authtoken]
auth_type = password
www_authenticate_uri = https://10.5.2.40:5000/v3
auth_url = https://10.5.2.40:35357/v3
project_domain_name = service_domain
user_domain_name = service_domain
project_name = services
username = glance
password = cbVtRMqPznc4M7XKVG73yPn5fBX4NXYSC4bMb7PGYTL5RkWXnc8ZsZ9hrJy2hynf
signing_dir = /var/cache/glance
service_type = image

memcached_servers = inet6:[::1]:11211


[paste_deploy]
flavor = keystone


[barbican]
auth_endpoint = https://10.5.2.40:5000/v3

[database]
connection = mysql+pymysql://glance:rM5hSHsw8JSV2mJVkcszMBxtVsHbG4MW@127.0.0.1/glance
connection_recycle_time = 3600


[oslo_messaging_rabbit]


[oslo_messaging_notifications]
driver = messagingv2
transport_url = rabbit://glance:4LzVZZLsPTrKw7c49ZdxqmJ8mkcWkSSnPJzgYyZWPMkrVzyB62CyCzzKVRnBS4Mz@10.5.0.95:5672/openstack




[oslo_middleware]

# Bug #1758675
enable_proxy_headers_parsing = true





[local]
filesystem_store_datadir = /var/lib/glance/images/
store_description = Local filesystem store
79 changes: 79 additions & 0 deletions tests/report_tests/plugin_tests/openstack/keystone.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[DEFAULT]
use_syslog = False
log_config_append = /etc/keystone/logging.conf
debug = True
public_endpoint = https://10.5.2.40:5000
admin_endpoint = https://10.5.2.40:35357

[database]
connection = mysql+pymysql://keystone:2zx9jZZtxdn4grG3xcMV4PwgGwY7X7fP@127.0.0.1/keystone
connection_recycle_time = 200

[identity]
driver = sql
default_domain_id = default
domain_specific_drivers_enabled = True
domain_config_dir = /etc/keystone/domains
[credential]
driver = sql
auth_ttl = 15

[trust]
driver = sql

[catalog]
cache_time = 60
driver = sql

[endpoint_filter]

[token]
expiration = 3600

[fernet_tokens]
max_active_keys = 3



[cache]

enabled = true
backend = oslo_cache.memcache_pool
memcache_servers = inet6:[::1]:11211

# This goes in the section above, selectively
# Bug #1899117
expiration_time = 600

[policy]
driver = sql

[assignment]
driver = sql

[auth]
methods = external,password,token,oauth1,openid,totp,application_credential

[paste_deploy]
config_file = /etc/keystone/keystone-paste.ini

[extra_headers]
Distribution = Ubuntu

[ldap]

[resource]
admin_project_domain_name = admin_domain
admin_project_name = admin



[oslo_middleware]

# Bug #1758675
enable_proxy_headers_parsing = true

# This goes in the section above, selectively
# Bug #1819134
max_request_body_size = 114688

33 changes: 33 additions & 0 deletions tests/report_tests/plugin_tests/openstack/keystone.domain1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[ldap]
url = ldap://10.0.1.124
user = cn=admin,dc=test,dc=com
password = crapper
suffix = dc=test,dc=com

user_allow_create = False
user_allow_update = False
user_allow_delete = False

group_allow_create = False
group_allow_update = False
group_allow_delete = False

# User supplied configuration flags
group_desc_attribute = description
group_id_attribute = cn
group_member_attribute = memberUid
group_members_are_ids = True
group_name_attribute = cn
group_objectclass = posixGroup
group_tree_dn = ou=groups,dc=test,dc=com
pool_retry_max = 1
pool_size = 10
query_scope = sub
use_pool = True
user_attribute_ignore = userPassword
user_id_attribute = uid
user_name_attribute = uid
user_objectclass = posixAccount
user_tree_dn = ou=users,dc=test,dc=com
[identity]
driver = ldap

0 comments on commit d683bd2

Please sign in to comment.