OpenStack 构建单测环境
单元测试构建测试环境
sudo apt-get install build-essential libssl-dev libffi-dev python-dev libevent-dev
http://ronaldbradford.com/blog/running-openstack-tests-with-tox-2015-04-28/?utm_source=tuicool&utm_medium=referral
http://docs.openstack.org/developer/cinder/devref/development.environment.html
http://superuser.openstack.org/articles/a-guide-to-testing-in-openstack/
执行单个测试项
.tox/py27/bin/python -m testtools.runxxxxxx
e.g =》.tox/py27/bin/python -m testtools.runneutron.tests.unit.agent.test_securitygroups_rpc.TestSecurityGroupAgentWithOVSIptables.test_prepare_remove_port
测试参考
https://docs.openstack.org/developer/ceilometer/testing.html
http://www.voidspace.org.uk/python/mock/getting-started.html
http://www.oschina.net/translate/unit-testing-with-the-python-mock-class
创建基础网络
创建外部网络
neutron net-create ext-net --router:external=True --provider:network-type=flat --provider:physical-network=provider
neutron subnet-create ext-net --name ext-subnet --allocation-pool start=192.168.100.150,end=192.168.100.200 --disable-dhcp --gateway 192.168.100.2 192.168.100.0/24
页:
[1]