Several hyperlinks were incorrectly specified in one page of the docs. These syntax typos have been fixed. Change-Id: I1a4fe91ac05f51b71e01c001b76712752664ae74 Closes-Bug: #1268611
3.7 KiB
Setting Up a Development Environment
This page describes how to setup a working Python development environment that can be used in developing Neutron on Ubuntu, Fedora or Mac OS X. These instructions assume you're already familiar with Git and Gerrit, which is a code repository mirror and code review toolset , however if you aren't please see this Git tutorial for an introduction to using Git and this wiki page for a tutorial on using Gerrit and Git for code contribution to Openstack projects.
Following these instructions will allow you to run the Neutron unit tests. If you want to be able to run Neutron in a full OpenStack environment, you can use the excellent DevStack project to do so. There is a wiki page that describes setting up Neutron using DevStack.
Virtual environments
Testing OpenStack projects, including Neutron, is made easier with DevStack.
Create a machine (such as a VM or Vagrant box) running a distribution supported by DevStack and install DevStack there. For example, there is a Vagrant script for DevStack at https://github.com/jogo/DevstackUp.
Note
If you prefer not to use DevStack, you can still check out source code on your local machine and develop from there.
Getting the code
Grab the code from GitHub:
git clone git://git.openstack.org/openstack/neutron.git
cd neutron
Running unit tests
With run_tests.sh
You can use the run_tests.sh script in the root source directory to execute tests in a virtualenv:
./run_tests -V
With tox
Neutron, like other OpenStack projects, uses tox for managing the virtual environments for running test cases. It uses Testr for managing the running of the test cases.
Tox handles the creation of a series of virtualenvs that target specific versions of Python (2.6, 2.7, 3.3, etc).
Testr handles the parallel execution of series of test cases as well as the tracking of long-running tests and other things.
Running unit tests is as easy as executing this in the root directory of the Neutron source code:
tox
For more information on the standard Tox-based test infrastructure used by OpenStack and how to do some common test/debugging procedures with Testr, see this wiki page:
Using a remote debugger
Beef up and add examples to content at https://wiki.openstack.org/wiki/NeutronDevelopment#How_to_debug_Neutron_.28and_other_OpenStack_projects_probably_.29