Wednesday, March 11, 2015

Quickly Running A Single OpenStack Nova Test

Here’s how we usually run a single test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
dims@dims-mac:~/openstack/nova$ time tox -e py27 nova.tests.unit.test_versions
py27 develop-inst-noop: /Users/dims/openstack/nova
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | find . -type f -name *.pyc -delete
py27 runtests: commands[1] | bash tools/pretty_tox.sh nova.tests.unit.test_versions
{1} nova.tests.unit.test_versions.VersionTestCase.test_version_string_with_package_is_good [0.180036s] ... ok
{0} nova.tests.unit.test_versions.VersionTestCase.test_release_file [0.184115s] ... ok
 
======
Totals
======
Ran: 2 tests in 13.0000 sec.
 - Passed: 2
 - Skipped: 0
 - Failed: 0
Sum of execute time for each test: 0.3642 sec.
 
==============
Worker Balance
==============
 - Worker 0 (1 tests) => 0:00:00.184115s
 - Worker 1 (1 tests) => 0:00:00.180036s
________________________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________________________
  py27: commands succeeded
  congratulations <span class="wp-smiley wp-emoji wp-emoji-smile" title=":)">:)</span>
 
real    0m14.452s
user    0m16.392s
sys 0m2.354s
Sometimes the usual way is not very helpful, especially when you are working on some new code and say running into issues importing code. Then, here’s what you do.
First, activate the py27 virtualenv
1
dims@dims-mac:~/openstack/nova$ . .tox/py27/bin/activate
Then use testtools
1
2
3
4
5
(py27)dims@dims-mac:~/openstack/nova$ python -m testtools.run nova.tests.unit.test_versions
Tests running...
 
Ran 2 tests in 0.090s
OK
Or you can install pytest
1
2
3
4
5
6
7
8
9
10
11
12
13
(py27)dims@dims-mac:~/openstack/nova$ pip install pytest
Collecting pytest
  Downloading pytest-2.6.4.tar.gz (512kB)
    100% |################################| 516kB 877kB/s
Collecting py>=1.4.25 (from pytest)
  Downloading py-1.4.26.tar.gz (190kB)
    100% |################################| 192kB 4.3MB/s
Installing collected packages: py, pytest
  Running setup.py install for py
  Running setup.py install for pytest
    Installing py.test-2.7 script to /Users/dims/openstack/nova/.tox/py27/bin
    Installing py.test script to /Users/dims/openstack/nova/.tox/py27/bin
Successfully installed py-1.4.26 pytest-2.6.4
And then run the same test using py.test
1
2
3
4
5
6
7
8
9
10
11
12
(py27)dims@dims-mac:~/openstack/nova$ find . -name py.test
./.tox/py27/bin/py.test
 
(py27)dims@dims-mac:~/openstack/nova$ .tox/py27/bin/py.test -svx nova/tests/unit/test_versions.py
================================================================================================================== test session starts ===================================================================================================================
platform darwin -- Python 2.7.8 -- py-1.4.26 -- pytest-2.6.4 -- /Users/dims/openstack/nova/.tox/py27/bin/python2.7
collected 2 items
 
nova/tests/unit/test_versions.py::VersionTestCase::test_release_file PASSED
nova/tests/unit/test_versions.py::VersionTestCase::test_version_string_with_package_is_good PASSED
 
================================================================================================================ 2 passed in 1.69 seconds ================================================================================================================
These tips are based on the openstack-dev mailing list discussion:
http://openstack.markmail.org/thread/wetxcnhuq6b7auhn

Tuesday, March 10, 2015

Helion 1.1 depoly

Helion is delivered as a set of images plus a configuration utility:

Seed Cloud Image - A bootable image that is deployed into a VM
Undercloud Image - An image that is deployed by the Seed cloud onto a single physical server to create the Undercloud
Overcloud Images - Images that are deployed onto physical servers by the Undercloud. Overcloud images have specialised roles:   Mgmt., Swift, and Compute
Users are not able to (re)build the images.  Direct editing of the heat templates is possible but not supported.  Configuration is limited to those items supported by the configuration tool and Horizon.

Community Edition releases will follow the upstream Milestones (Icehouse, Juno.1, Juno,2, etc).  Not all images will change for every release; Seed and Undercloud images (being simple, single purpose systems) may remain on earlier versions.

Helion used the standard TripleO deployment model:

A seed cloud (a sealed bootable image provided as part of Helion) is deployed in a VM.  This image contains a small but operational OpenStack cloud.  The user adds a single bare-metal node to the SeedCloud and provisions it with the Undercloud Image.    This server then becomes the Undercloud.
The Undercloud image is also a complete OpenStack Cloud running on a single physical server, which will be used to deploy and update the Overcloud (the general purpose,.multi-node cloud that will host customers VMs and applications)
Physical servers are added to the Undercloud and then provisioned with Overcloud images.   Image deployment includes post-deployment configuration via Heat.

Setup OpenFlow testing env on windows

1: download and install VMware player

2: download Mininet VM http://downloads.mininet.org/mininet-2.2.0-150106-ubuntu-14.04-server-amd64.zip

3: import mininet vm into VMware player

4: download and install XMing server on windows

5: Launch XMing server

6: SSH into the mininet vm using putty with X11 forward

7:  Started wireshark:
     $sudo wireshar &

8:  Capture interface lo in wireshark 

9:   Click expression to select of - openflow then Click apply button

Tuesday, March 3, 2015