Page tree
Skip to end of metadata
Go to start of metadata

Intel Lab:

Integration is done through Releng. A Jenkins job run daily and invoke a deploy.sh from the multisite repo script, that will install, configure and run the kingbird services.

Prerequisite: 

  • Keystone must run centrally.
  • Set quota_driver=DbQuotaDriver in nova.conf to enforce quotas.

The following script registers the endpoints from second site in Keystone as RegionTwo in Fuel based OpenStack deployment.

#!/bin/bash

source openrc

#openstack endpoint create --publicurl "" --adminurl "" --internalurl "" --region RegionTwo <service>

public_url=172.16.0.6
internal_url=192.168.0.8
admin_url=$internal_url

# Nova
openstack endpoint create --publicurl "http://${public_url}:8774/v2.1" --adminurl "http://${admin_url}:8774/v2.1" --internalurl "http://${internal_url}:8774/v2.1" --region RegionTwo nova
openstack endpoint create --publicurl "http://${public_url}:8774/v2/%(tenant_id)s" --adminurl "http://${admin_url}:8774/v2/%(tenant_id)s" --internalurl "http://${internal_url}:8774/v2/%(tenant_id)s" --region RegionTwo compute_legacy
# Neutron
openstack endpoint create --publicurl "http://${public_url}:9696" --adminurl "http://${admin_url}:9696" --internalurl "http://${internal_url}:9696" --region RegionTwo neutron
# Cinder
openstack endpoint create --publicurl "http://${public_url}:8776/v1/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v1/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v1/%(tenant_id)s" --region RegionTwo cinder
openstack endpoint create --publicurl "http://${public_url}:8776/v2/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v2/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v2/%(tenant_id)s" --region RegionTwo cinderv2
openstack endpoint create --publicurl "http://${public_url}:8776/v3/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v3/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v3/%(tenant_id)s" --region RegionTwo cinderv3
# Glance
openstack endpoint create --publicurl "http://${public_url}:9292" --adminurl "http://${admin_url}:9292" --internalurl "http://${internal_url}:9292" --region RegionTwo glance
# Heat 
openstack endpoint create --publicurl "http://${public_url}:8004/v1/%(tenant_id)s" --adminurl "http://${admin_url}:8004/v1/%(tenant_id)s" --internalurl "http://${internal_url}:8004/v1/%(tenant_id)s" --region RegionTwo heat
openstack endpoint create --publicurl "http://${public_url}:8000/v1" --adminurl "http://${admin_url}:8000/v1" --internalurl "http://${internal_url}:8000/v1" --region RegionTwo heat-cfn
# Swift
openstack endpoint create --publicurl "http://${public_url}:8080/swift/v1" --adminurl "http://${admin_url}:8080/swift/v1" --internalurl "http://${internal_url}:8080/swift/v1" --region RegionTwo swift
# Glare
openstack endpoint create --publicurl "http://${public_url}:9494" --adminurl "http://${admin_url}:9494" --internalurl "http://${internal_url}:9494" --region RegionTwo swift

 

Then, the admin passwords for each service must be overwritten in region two: In region One retrieve passwords from the keystone_auth_token section of a configuration file for each service and use the value to overwrite the password in the same section in region Two.

 

Shanghai Lab:


========================================================
Prepare the Kingbird service in OpenStack regionTwo
========================================================

#generate configuration
git clone https://github.com/openstack/kingbird.git
cd kingbird/
tox egenconfig
cp etc/kingbird/kingbird.conf.sample /etc/kingbird/kingbird.conf

#configure the kingbird, mainly DB/KeyStone/MessageBus
vim /etc/kingbird/kingbird.conf
#in mysql create the DB
mysql -uroot
CREATE DATABASE kingbird;
# in ~/kingbird/kingbird/cmd
python manage.py db_sync
# in ~/kingbird , install dependecy
vim ~/.pip/pip.conf 
pip install -e .
# run kingbird service
nohup python api.py --config-file=/etc/kingbird/kingbird.conf &
nohup python engine.py --config-file=/etc/kingbird/kingbird.conf &
# create openstack endpoint
source adminrc
openstack service create --name=kingbird synchronization
openstack endpoint create <kb_service_id> --region=RegionTwo  --publicurl http://192.168.20.212:8118/v1.0 --adminurl http://192.168.20.212:8118/v1.0 --internalurl http://192.168.20.212:8118/v1.0

 # test the service is running
curl http://192.168.20.212:8118/v1.0

==================================================
Add kingbird to the Functest contrainer of OPNFV:
==================================================
#in the host while OpenStack is running
docker run -it $FUNCTEST_CONTAINER_IMAGE bash
#in container
apt-get install vim
pip install tox --upgrade
#install kingbird into the container
cd repos/
mkdir kb
cd kb/
git clone https://github.com/openstack/kingbird.git
cd kingbird/
pip install -e .
cd ../../tempest/
testr list-tests | grep kingbird
#tempest is old version, so need to update it to latest code:
git pull
# run prepare_env.sh according to http://artifacts.opnfv.org/functest/brahmaputra/docs/devguide/index.html
# but not found, so have to edit the tox
vim tox.ini
(change "OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}" to "OS_TEST_TIMEOUT=1200", should run pre_test.sh to get environment variables, but not found)
#generate and edit the configuration file
tox -e genconfig
cp  /etc/tempest.conf.sample /etc/tempest.conf
vim /etc/tempest.conf
#please be aware of that tempest has deprecated many configuration items in the [identity] section, you have to use [auth] section for configuration as much as possible.
#in tempest folder
tox -e all-plugin -- scenario.quota_management.client_tests
#some error in the following files, correct it, because tempest configuration items deprecation
vim /home/opnfv/repos/kb/kingbird/kingbird/tests/tempest/scenario/quota_management/client_tests/base.py
vim /home/opnfv/repos/kb/kingbird/kingbird/tests/tempest/scenario/quota_management/sync_client.py
vim /home/opnfv/repos/kb/kingbird/kingbird/tests/tempest/scenario/plugin.py
vim /home/opnfv/repos/kb/kingbird/kingbird/tests/tempest/scenario/config.py
#after modify the source code, re-install the package
cd ~/repos/kb/kingbird
pip install -e .
# make sure container can access the OpenStack service in the host
cd ../../tempest/
vim adminrc
source adminrc
openstack endpoint list
curl http://192.168.20.212:8118/v1.0
# in tempest root folder
tox -e all-plugin -- scenario.quota_management.client_tests

==============================================================
Enter or re-enter the running contrainer to re-run the test
==============================================================

docker exec -it 1fe02ef0543b bash
cd repos/tempest/
root@1fe02ef0543b:~/repos/tempest# tox -e all-plugin -- scenario.quota_management.client_tests
all-plugin develop-inst-noop: /home/opnfv/repos/tempest
all-plugin installed: alembic==0.8.6,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,beautifulsoup4==4.4.1,boto==2.40.0,cachetools==1.1.6,cffi==1.6.0,chardet==2.0.1,click==6.6,cliff==2.0.0,cmd2==0.6.8,colorama==0.2.5,configobj==5.0.6,contextlib2==0.5.3,cryptography==1.3.4,debtcollector==1.4.0,decorator==4.0.9,docutils==0.12,dogpile.cache==0.5.7,dogpile.core==0.4.1,ecdsa==0.13,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,Flask==0.10.1,funcsigs==1.0.2,functest===colorado.0.1,functools32==3.2.3.post2,futures==3.0.5,futurist==0.14.0,gitdb==0.6.4,GitPython==1.0.1,greenlet==0.4.9,-e git+https://github.com/MBonell/hello-world-tempest-plugin.git@1af53779f70b2862b360149b21455ec603371a7d#egg=hello_world_tempest_plugin,html5lib==0.999,httplib2==0.9.2,idna==2.1,iniparse==0.4,ipaddress==1.0.16,iso8601==0.1.11,itsdangerous==0.24,Jinja2==2.8,jsonpatch==1.13,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.6.0,keystonemiddleware==4.5.1,-e git+https://github.com/openstack/kingbird.git@de100d46a5cd6a260a8697c1449b6ce5310cb5e7#egg=kingbird,kombu==3.0.35,linecache2==1.0.0,logutils==0.3.3,Mako==1.0.4,MarkupSafe==0.23,monotonic==1.1,msgpack-python==0.4.7,netaddr==0.7.18,netifaces==0.10.4,openstacksdk==0.8.5,ordereddict==1.1,os-client-config==1.17.0,os-testr==0.7.0,oslo.concurrency==3.9.0,oslo.config==3.10.0,oslo.context==2.4.0,oslo.db==4.7.0,oslo.i18n==3.6.0,oslo.log==3.8.0,oslo.messaging==5.2.0,oslo.middleware==3.11.0,oslo.policy==1.8.0,oslo.rootwrap==4.2.0,oslo.serialization==2.7.0,oslo.service==1.11.0,oslo.utils==3.11.0,oslo.versionedobjects==1.9.1,paramiko==2.0.0,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pecan==1.1.0,pexpect==4.0,pika==0.10.0,pika-pool==0.1.3,pluggy==0.3.1,positional==1.1.0,prettytable==0.7.2,ptyprocess==0.5.1,py==1.4.31,pyasn1==0.1.9,pycadf==2.3.0,pycparser==2.14,pycrypto==2.6.1,Pygments==2.1.3,pyinotify==0.9.6,pyOpenSSL==16.0.0,pyparsing==2.1.4,python-ceilometerclient==2.4.0,python-cinderclient==1.6.0,python-dateutil==2.5.3,python-designateclient==2.1.0,python-editor==1.0,python-glanceclient==2.0.0,python-heatclient==1.2.0,python-ironicclient==1.3.0,python-keystoneclient==3.0.0,python-manilaclient==1.8.1,python-mimeparse==1.5.2,python-neutronclient==4.2.0,python-novaclient==4.0.0,python-openstackclient==2.3.0,python-saharaclient==0.14.0,python-subunit==1.2.0,python-swiftclient==3.0.0,python-troveclient==2.2.0,python-zaqarclient==1.0.0,pytz==2016.4,PyYAML==3.11,rally==0.3.3,repoze.lru==0.6,requests==2.10.0,requestsexceptions==1.1.3,retrying==1.3.3,robotframework==2.9.1,robotframework-requests==0.3.8,robotframework-sshlibrary==2.1.1,Routes==2.3.1,scp==0.10.2,simplejson==3.8.2,singledispatch==3.4.0.3,six==1.10.0,smmap==0.9.0,Sphinx==1.2.3,SQLAlchemy==1.0.12,sqlalchemy-migrate==0.10.0,sqlparse==0.1.19,stevedore==1.14.0,-e git+https://github.com/openstack/tempest.git@9d38fa4001aaea335ee029124700ac794c200698#egg=tempest,Tempita==0.5.2,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,tox==2.3.1,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,urllib3==1.15.1,virtualenv==15.0.2,waitress==0.9.0,warlock==1.2.0,WebOb==1.6.1,WebTest==2.0.21,Werkzeug==0.11.9,wrapt==1.10.8,xmltodict==0.9.2
all-plugin runtests: PYTHONHASHSEED='653401817'
all-plugin runtests: commands[0] | find . -type f -name *.pyc -delete
all-plugin runtests: commands[1] | bash tools/pretty_tox.sh scenario.quota_management.client_tests
running testr
2016-06-07 06:57:36.533 2389 INFO tempest [-] Using tempest config file /etc/tempest/tempest.conf
2016-06-07 06:57:36.542 2389 WARNING oslo_config.cfg [-] Option "endpoint_type" from group "identity" is deprecated. Use option "v2_public_endpoint_type" from group "identity".
2016-06-07 06:57:38.282 2389 INFO tempest.lib.common.rest_client [req-b3797fa2-4e0e-4bea-8f7c-cde4c75bffcf ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:38.468 2389 INFO tempest.lib.common.rest_client [req-23e57d0a-2df0-43b7-8818-74e2123d5f69 ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:38.531 2389 INFO tempest.lib.common.rest_client [req-3768d0f8-16b8-4287-b486-ae1b41ae06b3 ] Request (main): 200 GET http://172.16.1.222:35357/v3/domains?name=default 0.050s
2016-06-07 06:57:38.579 2389 INFO tempest.lib.common.rest_client [req-a571b266-6c53-4a6a-8c3e-51f2ccdfb028 ] Request (main): 201 POST http://172.16.1.222:35357/v3/projects 0.047s
2016-06-07 06:57:38.634 2389 INFO tempest.lib.common.rest_client [req-a8864fe6-6efe-48dc-b42a-b4fbb3671a72 ] Request (main): 201 POST http://172.16.1.222:35357/v3/users 0.054s
2016-06-07 06:57:38.663 2389 INFO tempest.lib.common.rest_client [req-4e6b5074-a03f-4088-af69-1c7df460722e ] Request (main): 200 GET http://172.16.1.222:35357/v3/roles 0.028s
2016-06-07 06:57:38.693 2389 INFO tempest.lib.common.rest_client [req-693aa494-eee6-43a6-b555-ee020453a420 ] Request (main): 200 GET http://172.16.1.222:35357/v3/roles 0.029s
2016-06-07 06:57:38.759 2389 INFO tempest.lib.common.rest_client [req-a7f022fe-11da-4147-801d-faa03f792fe6 ] Request (main): 204 PUT http://172.16.1.222:35357/v3/projects/4f6016c1c61a4a8c9b050ad18fbec661/users/bb429f29d5a245a7b8a6e791bcd87b11/roles/9020e3442fa54335acd8ca64139174dd 0.065s
2016-06-07 06:57:38.760 2389 INFO tempest.common.dynamic_creds [-] Acquired dynamic creds:
credentials: Credentials: {'project_name': u'tempest-InputScenarioUtils-1616242408', 'user_domain_name': u'Default', 'domain_name': None, 'tenant_name': u'tempest-InputScenarioUtils-1616242408', 'project_domain_id': u'default', 'tenant_id': u'4f6016c1c61a4a8c9b050ad18fbec661', 'username': u'tempest-InputScenarioUtils-1616242408', 'project_id': u'4f6016c1c61a4a8c9b050ad18fbec661', 'user_id': u'bb429f29d5a245a7b8a6e791bcd87b11', 'domain_id': None, 'project_domain_name': u'Default', 'user_domain_id': u'default'}, Network: None, Subnet: None, Router: None
2016-06-07 06:57:38.892 2389 INFO tempest.lib.common.rest_client [req-bcc15809-8bc5-4b8a-b899-3afc9c0930f9 ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:39.001 2389 INFO tempest.lib.common.rest_client [req-2e2785ab-34a0-41e1-949c-5e54f2585448 ] Request (main): 200 GET http://192.168.20.222:8774/v2/4f6016c1c61a4a8c9b050ad18fbec661/flavors 0.104s
2016-06-07 06:57:39.114 2389 INFO tempest.lib.common.rest_client [req-dbd3847e-758d-4209-982c-72415506f730 ] Request (main): 200 GET http://192.168.20.222:8774/v2/4f6016c1c61a4a8c9b050ad18fbec661/images 0.108s
2016-06-07 06:57:39.284 2389 INFO tempest.lib.common.rest_client [req-08e4c022-64db-4b2b-abdb-a6837e7e3613 ] Request (main): 204 DELETE http://172.16.1.222:35357/v3/users/bb429f29d5a245a7b8a6e791bcd87b11 0.167s
2016-06-07 06:57:39.444 2389 INFO tempest.lib.common.rest_client [req-681b26fe-b5d1-49a4-a05d-69eb6efcda3c ] Request (main): 204 DELETE http://172.16.1.222:35357/v3/projects/4f6016c1c61a4a8c9b050ad18fbec661 0.158s
2016-06-07 06:57:41.338 2395 INFO tempest [-] Using tempest config file /etc/tempest/tempest.conf
2016-06-07 06:57:41.349 2395 WARNING oslo_config.cfg [-] Option "endpoint_type" from group "identity" is deprecated. Use option "v2_public_endpoint_type" from group "identity".
2016-06-07 06:57:42.183 2395 INFO tempest.lib.common.rest_client [req-ceb18c9e-e8dc-4239-bce6-a4a441ef2fce ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:42.323 2395 INFO tempest.lib.common.rest_client [req-96920363-7757-4b3b-b576-a09d8c1e07a2 ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:42.442 2395 INFO tempest.lib.common.rest_client [req-192b8f2e-9caa-4ae6-8969-64adc1154be9 ] Request (main): 200 GET http://172.16.1.222:35357/v3/domains?name=default 0.107s
2016-06-07 06:57:42.494 2395 INFO tempest.lib.common.rest_client [req-d8ae0483-fa8e-4f56-876a-8f79adca71aa ] Request (main): 201 POST http://172.16.1.222:35357/v3/projects 0.050s
2016-06-07 06:57:42.561 2395 INFO tempest.lib.common.rest_client [req-81681822-429e-474d-87d0-f2253161987c ] Request (main): 201 POST http://172.16.1.222:35357/v3/users 0.065s
2016-06-07 06:57:42.593 2395 INFO tempest.lib.common.rest_client [req-4c3509da-4a1c-45aa-ad40-00e057d5fd1b ] Request (main): 200 GET http://172.16.1.222:35357/v3/roles 0.030s
2016-06-07 06:57:42.631 2395 INFO tempest.lib.common.rest_client [req-c98c8a02-18fd-4567-9c2c-c7852870c1f3 ] Request (main): 200 GET http://172.16.1.222:35357/v3/roles 0.037s
2016-06-07 06:57:42.696 2395 INFO tempest.lib.common.rest_client [req-e6c0c986-2e0b-410a-86f0-6ca1fc52839b ] Request (main): 204 PUT http://172.16.1.222:35357/v3/projects/61e3cd6fe25441d9b73821d98beaf04c/users/b2fa94517ef544d4921dcfe8cce73b8b/roles/9020e3442fa54335acd8ca64139174dd 0.064s
2016-06-07 06:57:42.696 2395 INFO tempest.common.dynamic_creds [-] Acquired dynamic creds:
credentials: Credentials: {'project_name': u'tempest-InputScenarioUtils-185341484', 'user_domain_name': u'Default', 'domain_name': None, 'tenant_name': u'tempest-InputScenarioUtils-185341484', 'project_domain_id': u'default', 'tenant_id': u'61e3cd6fe25441d9b73821d98beaf04c', 'username': u'tempest-InputScenarioUtils-185341484', 'project_id': u'61e3cd6fe25441d9b73821d98beaf04c', 'user_id': u'b2fa94517ef544d4921dcfe8cce73b8b', 'domain_id': None, 'project_domain_name': u'Default', 'user_domain_id': u'default'}, Network: None, Subnet: None, Router: None
2016-06-07 06:57:42.853 2395 INFO tempest.lib.common.rest_client [req-6a04f7fa-9239-444e-831a-4c852d34a2e2 ] Request (main): 201 POST http://192.168.20.222:5000/v3/auth/tokens
2016-06-07 06:57:43.011 2395 INFO tempest.lib.common.rest_client [req-6eebff54-7ce9-4012-b6e4-7d72114eaa6f ] Request (main): 200 GET http://192.168.20.222:8774/v2/61e3cd6fe25441d9b73821d98beaf04c/flavors 0.151s
2016-06-07 06:57:43.111 2395 INFO tempest.lib.common.rest_client [req-15badcbd-8146-4920-8c72-f22e97e5ffb8 ] Request (main): 200 GET http://192.168.20.222:8774/v2/61e3cd6fe25441d9b73821d98beaf04c/images 0.096s
2016-06-07 06:57:43.284 2395 INFO tempest.lib.common.rest_client [req-9d16a3bf-e946-4f4e-99a1-6870a87e155e ] Request (main): 204 DELETE http://172.16.1.222:35357/v3/users/b2fa94517ef544d4921dcfe8cce73b8b 0.167s
2016-06-07 06:57:43.445 2395 INFO tempest.lib.common.rest_client [req-dc4acf76-d931-4407-b706-7f80e7dded06 ] Request (main): 204 DELETE http://172.16.1.222:35357/v3/projects/61e3cd6fe25441d9b73821d98beaf04c 0.160s
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list 
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --load-list /tmp/tmpm3I9Ne
('1111 cls.key_client %s', '<keystoneclient.v3.client.Client object at 0x7f7053241e10>')
2016-06-07 06:57:43.953 2395 WARNING tempest.test [-] Client manager not found, validation resources not created
('2222222 cls.regions %s', [u'regionTwo'])
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_get_quota_usage_for_project [3.205780s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_delete_all_method [0.046294s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_delete_method [0.037065s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_get_default_method_after_delete [0.058307s] ... ok
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_get_default_method_after_update [0.039351s] ... ok
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_get_method [0.025143s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_put_method [0.018767s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_kingbird_put_method_wrong_token [0.011779s] ... FAILED
{0} scenario.quota_management.client_tests.test_kingbird_api.KingbirdTestJSON.test_quota_exceed_after_sync [31.827345s] ... FAILED
  • No labels

2 Comments

  1. d kb/
    why we not download kingbird directly in repos/
  2. We can discard the kb directory and clone directly