Antoni Segura Puimedon has uploaded a new change for review.
Change subject: net_tests: Move network unit tests into package ......................................................................
net_tests: Move network unit tests into package
This patch brings together the network unit tests under a directory to improve the organization and as a possible step for a future cohesive network package with code and tests.
Change-Id: I6960ce365d67ab4bb0a5475d7957e6117bef7e60 Signed-off-by: Antoni S. Puimedon asegurap@redhat.com --- M configure.ac M tests/Makefile.am A tests/network/Makefile.am R tests/network/apiTests.py R tests/network/ipwrapperTests.py R tests/network/modelsTests.py R tests/network/netconfTests.py R tests/network/netconfpersistenceTests.py R tests/network/netinfoTests.py R tests/network/netmaskconversions R tests/network/tcTests.py R tests/network/tc_filter_show.out M tests/run_tests_local.sh.in 13 files changed, 63 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/26874/1
diff --git a/configure.ac b/configure.ac index 12828be..944e17f 100644 --- a/configure.ac +++ b/configure.ac @@ -267,6 +267,7 @@ lib/zombiereaper/Makefile tests/Makefile tests/functional/Makefile + tests/network/Makefile vds_bootstrap/Makefile vdsm-tool/Makefile vdsm/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index 39c6cad..6fb834f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2012 Red Hat, Inc. +# Copyright 2012-2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@
include $(top_srcdir)/build-aux/Makefile.subs
-SUBDIRS = functional +SUBDIRS = functional network
test_modules = \ alignmentScanTests.py \ @@ -29,7 +29,6 @@ cPopenTests.py \ capsTests.py \ clientifTests.py \ - configNetworkTests.py \ fileVolumeTests.py \ fileUtilTests.py \ fuserTests.py \ @@ -38,7 +37,6 @@ glusterTestData.py \ guestagentTests.py \ hooksTests.py \ - ipwrapperTests.py \ iscsiTests.py \ jsonRpcTests.py \ jsonRpcUtils.py \ @@ -52,10 +50,6 @@ mkimageTests.py \ monkeypatchTests.py \ mountTests.py \ - netconfpersistenceTests.py \ - netconfTests.py \ - netinfoTests.py \ - netmodelsTests.py \ outOfProcessTests.py \ parted_utils_tests.py \ permutationTests.py \ @@ -66,7 +60,6 @@ securableTests.py \ sslTests.py \ storageMailboxTests.py \ - tcTests.py \ toolTests.py \ transportWrapperTests.py \ utilsTests.py \ @@ -111,8 +104,6 @@ glusterVolumeTasks.xml \ lvs_3386c6f2-926f-42c4-839c-38287fac8998.out \ mem_info.out \ - netmaskconversions \ - tc_filter_show.out \ $(NULL)
dist_vdsmtests_PYTHON = \ diff --git a/tests/network/Makefile.am b/tests/network/Makefile.am new file mode 100644 index 0000000..f241a4b --- /dev/null +++ b/tests/network/Makefile.am @@ -0,0 +1,53 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +net_testsdir = ${vdsmtestsdir}/network + +dist_net_tests_PYTHON = \ + apiTests.py \ + ipwrapperTests.py \ + netconfpersistenceTests.py \ + netconfTests.py \ + netinfoTests.py \ + modelsTests.py \ + tcTests.py \ + $(NULL) + +MODULES = \ + network/apiTests.py \ + network/ipwrapperTests.py \ + network/netconfpersistenceTests.py \ + network/netconfTests.py \ + network/netinfoTests.py \ + network/modelsTests.py \ + network/tcTests.py \ + $(NULL) + + + +dist_net_tests_DATA = \ + netmaskconversions \ + tc_filter_show.out \ + $(NULL) + +check-local: + @echo '*** Running network tests. To skip this step place NOSE_EXCLUDE=.* ***' + @echo '*** into your environment. Do not submit untested code! ***' + $(top_srcdir)/tests/run_tests_local.sh $(MODULES) diff --git a/tests/configNetworkTests.py b/tests/network/apiTests.py similarity index 100% rename from tests/configNetworkTests.py rename to tests/network/apiTests.py diff --git a/tests/ipwrapperTests.py b/tests/network/ipwrapperTests.py similarity index 100% rename from tests/ipwrapperTests.py rename to tests/network/ipwrapperTests.py diff --git a/tests/netmodelsTests.py b/tests/network/modelsTests.py similarity index 98% rename from tests/netmodelsTests.py rename to tests/network/modelsTests.py index a2a3ee3..5da708b 100644 --- a/tests/netmodelsTests.py +++ b/tests/network/modelsTests.py @@ -34,7 +34,7 @@ from monkeypatch import MonkeyPatch
-class TestNetmodels(TestCaseBase): +class TestModels(TestCaseBase):
def testIsVlanIdValid(self): vlanIds = ('badValue', Vlan.MAX_ID + 1) diff --git a/tests/netconfTests.py b/tests/network/netconfTests.py similarity index 100% rename from tests/netconfTests.py rename to tests/network/netconfTests.py diff --git a/tests/netconfpersistenceTests.py b/tests/network/netconfpersistenceTests.py similarity index 100% rename from tests/netconfpersistenceTests.py rename to tests/network/netconfpersistenceTests.py diff --git a/tests/netinfoTests.py b/tests/network/netinfoTests.py similarity index 100% rename from tests/netinfoTests.py rename to tests/network/netinfoTests.py diff --git a/tests/netmaskconversions b/tests/network/netmaskconversions similarity index 100% rename from tests/netmaskconversions rename to tests/network/netmaskconversions diff --git a/tests/tcTests.py b/tests/network/tcTests.py similarity index 100% rename from tests/tcTests.py rename to tests/network/tcTests.py diff --git a/tests/tc_filter_show.out b/tests/network/tc_filter_show.out similarity index 100% rename from tests/tc_filter_show.out rename to tests/network/tc_filter_show.out diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in index 0a229c0..787d9b2 100644 --- a/tests/run_tests_local.sh.in +++ b/tests/run_tests_local.sh.in @@ -3,8 +3,11 @@ PYTHON_EXE="@PYTHON@" fi
-if [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.crt ] || [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.csr ] || [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.key ]; then - @top_srcdir@/tests/makecert.sh +# The following line is taken from http://stackoverflow.com/a/246128/206009 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then + $DIR/makecert.sh fi
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir@/tests/testrunner.py --local-modules $@ +PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$DIR/../lib:$DIR/../vdsm:$DIR/../client:$DIR/../vdsm_api:$PYTHONPATH" "$PYTHON_EXE" $DIR/testrunner.py --local-modules $@
oVirt Jenkins CI Server has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/8123/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/8236/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/7333/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 1: Code-Review-1
(3 comments)
http://gerrit.ovirt.org/#/c/26874/1/tests/network/Makefile.am File tests/network/Makefile.am:
Line 30: tcTests.py \ Line 31: $(NULL) Line 32: Line 33: MODULES = \ Line 34: network/apiTests.py \ do we have to repeat this list? Line 35: network/ipwrapperTests.py \ Line 36: network/netconfpersistenceTests.py \ Line 37: network/netconfTests.py \ Line 38: network/netinfoTests.py \
http://gerrit.ovirt.org/#/c/26874/1/tests/run_tests_local.sh.in File tests/run_tests_local.sh.in:
Line 1: #!/bin/sh If you have to use a bashism, make it explicit. Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5:
Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5: Line 6: # The following line is taken from http://stackoverflow.com/a/246128/206009 attribution is great, but please say what it does - it was not clear to me.
also, it's not clear to me why absolute paths are no longer good now. Line 7: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" Line 8: Line 9: if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then Line 10: $DIR/makecert.sh
Michal Skrivanek has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 1:
(1 comment)
http://gerrit.ovirt.org/#/c/26874/1/tests/run_tests_local.sh.in File tests/run_tests_local.sh.in:
Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5: Line 6: # The following line is taken from http://stackoverflow.com/a/246128/206009
attribution is great, but please say what it does - it was not clear to me.
if you get rid of that @PYTHON@ above you don't have to process the file anymore….it can be a simple .sh Line 7: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" Line 8: Line 9: if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then Line 10: $DIR/makecert.sh
Dan Kenigsberg has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 1:
(1 comment)
http://gerrit.ovirt.org/#/c/26874/1/tests/network/Makefile.am File tests/network/Makefile.am:
Line 48: $(NULL) Line 49: Line 50: check-local: Line 51: @echo '*** Running network tests. To skip this step place NOSE_EXCLUDE=.* ***' Line 52: @echo '*** into your environment. Do not submit untested code! ***' "compute" MODULES instead of copying it:
for m in $(dist_net_tests_PYTHON); do \ MODULES="$$MODULES network/$$m"; \ done; \ $(top_srcdir)/tests/run_tests_local.sh $$MODULES
Antoni Segura Puimedon has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 1:
(5 comments)
http://gerrit.ovirt.org/#/c/26874/1/tests/network/Makefile.am File tests/network/Makefile.am:
Line 30: tcTests.py \ Line 31: $(NULL) Line 32: Line 33: MODULES = \ Line 34: network/apiTests.py \
do we have to repeat this list?
Done Line 35: network/ipwrapperTests.py \ Line 36: network/netconfpersistenceTests.py \ Line 37: network/netconfTests.py \ Line 38: network/netinfoTests.py \
Line 48: $(NULL) Line 49: Line 50: check-local: Line 51: @echo '*** Running network tests. To skip this step place NOSE_EXCLUDE=.* ***' Line 52: @echo '*** into your environment. Do not submit untested code! ***'
"compute" MODULES instead of copying it:
Done
http://gerrit.ovirt.org/#/c/26874/1/tests/run_tests_local.sh.in File tests/run_tests_local.sh.in:
Line 1: #!/bin/sh
If you have to use a bashism, make it explicit.
Done Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5:
Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5: Line 6: # The following line is taken from http://stackoverflow.com/a/246128/206009
attribution is great, but please say what it does - it was not clear to me.
Done Line 7: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" Line 8: Line 9: if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then Line 10: $DIR/makecert.sh
Line 2: if [ -z "$PYTHON_EXE" ]; then Line 3: PYTHON_EXE="@PYTHON@" Line 4: fi Line 5: Line 6: # The following line is taken from http://stackoverflow.com/a/246128/206009
if you get rid of that @PYTHON@ above you don't have to process the file an
Done Line 7: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" Line 8: Line 9: if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then Line 10: $DIR/makecert.sh
oVirt Jenkins CI Server has posted comments on this change.
Change subject: net_tests: Move network unit tests into package ......................................................................
Patch Set 2:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/8705/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/7915/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/8836/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/577/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: net_tests: Move network unit tests into a subdirectory ......................................................................
Patch Set 3:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/8707/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/7917/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/8838/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/578/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: net_tests: Move network unit tests into a subdirectory ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/8782/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/8918/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/7992/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/590/ : SUCCESS
Itamar Heim has posted comments on this change.
Change subject: net_tests: Move network unit tests into a subdirectory ......................................................................
Patch Set 4:
ping
Nir Soffer has posted comments on this change.
Change subject: net_tests: Move network unit tests into a subdirectory ......................................................................
Patch Set 4:
(1 comment)
I like the idea.
http://gerrit.ovirt.org/#/c/26874/4//COMMIT_MSG Commit Message:
Line 10: sets all the networking ones apart into a subdirectory. They will Line 11: still run on make rpm and it is possible to run them all separately Line 12: doing from tests/network Line 13: Line 14: make check-local Toni, will the test run when running make check in the root directory?
I guess that the chance of breaking the network tests by modifying unrelated files is small, but there should be easy way to run everything. Line 15: Line 16: Change-Id: I6960ce365d67ab4bb0a5475d7957e6117bef7e60
Antoni Segura Puimedon has abandoned this change.
Change subject: net_tests: Move network unit tests into a subdirectory ......................................................................
Abandoned
Has to be re-done
vdsm-patches@lists.fedorahosted.org