From 2184460b655c66b68d498620bc522ce54ab3b118 Mon Sep 17 00:00:00 2001 From: Shweta P <shpadubi@cisco.com> Date: Mon, 5 Dec 2011 07:58:58 -0500 Subject: [PATCH] Modified the Readme for Unit Test Execution Instructions Change-Id: Ib7ff79c166e34c4f99a8df55feb0191f37555597 Removed the trailing whitespaces in the README Change-Id: Ic2299bf35d9e0d8512ae4f57976884d12ba92159 --- quantum/plugins/cisco/README | 69 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/quantum/plugins/cisco/README b/quantum/plugins/cisco/README index a539ab4e88e..8a417e1340d 100755 --- a/quantum/plugins/cisco/README +++ b/quantum/plugins/cisco/README @@ -377,52 +377,54 @@ How to test the installation ---------------------------- The unit tests are located at quantum/plugins/cisco/tests/unit. They can be executed from the main folder using the run_tests.sh or to get a more detailed -result the quantum/plugins/cisco/run_tests.py script. +result the run_tests.py script. -1. Testing the core API (without UCS/Nexus/RHEL hardware, and can be run on +1. All unit tests (needs environment setup as indicated in the pre-requisites): + + ./run_tests.sh -N quantum.plugins.cisco.tests.unit + + or by modifying the environment variable to point to the plugin directory + + In bash : export PLUGIN_DIR=quantum/plugins/cisco + tcsh/csh : setenv PLUGIN_DIR quantum/plugins/cisco + + ./run_tests.sh -N + + Another option is to execute the python script run_tests.py + + python run_tests.py quantum.plugins.cisco.tests.unit + +2. Testing the core API (without UCS/Nexus/RHEL hardware, and can be run on Ubuntu): - First disable all device-specific plugins by commenting out the entries in: - quantum/plugins/cisco/conf/plugins.ini - Then run the test script: + Device-specific plugins can be disabled by commenting out the entries in: + etc/quantum/plugins/cisco/cisco_plugins.ini + The Core API can be tested by initially disabling all device plugins, then + enabling just the UCS plugins, and finally enabling both the UCS and the + Nexus plugins. + Execute the test script as follows: - Set the environment variable PLUGIN_DIR to the location of the plugin - directory. This is manadatory if the run_tests.sh script is used. - - In bash : export PLUGIN_DIR=quantum/plugins/cisco - tcsh/csh : setenv PLUGIN_DIR quantum/plugins/cisco - ./run_tests.sh quantum.plugins.cisco.tests.unit.test_l2networkApi + ./run_tests.sh -N quantum.plugins.cisco.tests.unit.test_l2networkApi or - python quantum/plugins/cisco/run_tests.py - quantum.plugins.cisco.tests.unit.test_l2networkApi + python run_tests.py quantum.plugins.cisco.tests.unit.test_l2networkApi -2. Specific Plugin unit test (needs environment setup as indicated in the +3. Specific Plugin unit test (needs environment setup as indicated in the pre-requisites): - In bash : export PLUGIN_DIR=quantum/plugins/cisco - tcsh/csh : setenv PLUGIN_DIR quantum/plugins/cisco - ./run_tests.sh quantum.plugins.cisco.tests.unit.<name_of_the file> + ./run_tests.sh -N quantum.plugins.cisco.tests.unit.<name_of_the file> - or + or - python <path to the plugin directory>/run_tests.py - quantum.plugins.cisco.tests.unit.<name_of_the file> + python run_tests.py quantum.plugins.cisco.tests.unit.<name_of_the file> E.g.: - python quantum/plugins/cisco/run_tests.py - quantum.plugins.cisco.tests.unit.test_ucs_plugin + python run_tests.py quantum.plugins.cisco.tests.unit.test_ucs_plugin -3. All unit tests (needs environment setup as indicated in the pre-requisites): - - In bash : export PLUGIN_DIR=quantum/plugins/cisco - tcsh/csh : setenv PLUGIN_DIR quantum/plugins/cisco + To run specific tests, use the following: + python run_tests.py + quantum.plugins.cisco.tests.unit.<name_of_the file>:<ClassName>.<funcName> - ./run_tests.sh quantum.plugins.cisco.tests.unit - - or - - python quantum/plugins/cisco/run_tests.py quantum.plugins.cisco.tests.unit 4. Testing the Extension API The script is placed alongwith the other cisco unit tests. The location may @@ -430,15 +432,12 @@ result the quantum/plugins/cisco/run_tests.py script. Location quantum/plugins/cisco/tests/unit/test_cisco_extension.py The script can be executed by : - ./run_tests.sh quantum.plugins.cisco.tests.unit.test_cisco_extension + ./run_tests.sh -N quantum.plugins.cisco.tests.unit.test_cisco_extension or python run_tests.py quantum.plugins.cisco.tests.unit.test_cisco_extension - To run specific tests - python run_tests.py - quantum.plugins.cisco.tests.unit.test_cisco_extension:<ClassName>.<funcName> Bingo bango bongo! That's it! Thanks for taking the leap into Quantum.