Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-25 Thread danken
Dan Kenigsberg has submitted this change and it was merged.

Change subject: tests: Separate tests with similar fixtures
..


tests: Separate tests with similar fixtures

The tests for exposed functions were testing multiple functions in one
test. This cause unrelated failure to fail the whole test. The correct
way to test this is having separate test for each function.

Now we have separate test case class for the positive and negative
tests, sharing the same configurators setup.

Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Signed-off-by: Nir Soffer 
Reviewed-on: https://gerrit.ovirt.org/41364
Continuous-Integration: Jenkins CI
Reviewed-by: Dima Kuznetsov 
Reviewed-by: Yaniv Bronhaim 
Reviewed-by: Dan Kenigsberg 
---
M tests/toolTests.py
1 file changed, 63 insertions(+), 53 deletions(-)

Approvals:
  Nir Soffer: Verified
  Yaniv Bronhaim: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dima Kuznetsov: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Dima Kuznetsov 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-25 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 2:

* Update tracker::IGNORE, no Bug-Url found
* Set MODIFIED::IGNORE, no Bug-Url found.

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Dima Kuznetsov 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-25 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 1: Code-Review+2

raising

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Antoni Segura Puimedon 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Dima Kuznetsov 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: mooli tayer 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-25 Thread ybronhei
Yaniv Bronhaim has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Antoni Segura Puimedon 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Dima Kuznetsov 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: mooli tayer 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-24 Thread dkuznets
Dima Kuznetsov has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Antoni Segura Puimedon 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Dima Kuznetsov 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: mooli tayer 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-24 Thread nsoffer
Nir Soffer has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-24 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: tests: Separate tests with similar fixtures
..


Patch Set 1:

* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 
'ovirt-3.4', 'ovirt-3.3'])

-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: Separate tests with similar fixtures

2015-05-24 Thread nsoffer
Nir Soffer has uploaded a new change for review.

Change subject: tests: Separate tests with similar fixtures
..

tests: Separate tests with similar fixtures

The tests for exposed functions were testing multiple functions in one
test. This cause unrelated failure to fail the whole test. The correct
way to test this is having separate test for each function.

Now we have separate test case class for the positive and negative
tests, sharing the same configurators setup.

Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Signed-off-by: Nir Soffer 
---
M tests/toolTests.py
1 file changed, 63 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/41364/1

diff --git a/tests/toolTests.py b/tests/toolTests.py
index 9f6e43e..bff299a 100644
--- a/tests/toolTests.py
+++ b/tests/toolTests.py
@@ -194,59 +194,6 @@
 '--module=multipath'
 )
 
-@ValidateRunningAsRoot
-@patchConfigurators(
-(
-MockModuleConfigurator('a', should_succeed=False),
-MockModuleConfigurator('b', should_succeed=False),
-
-)
-)
-def testFailuresOnExposedFuncs(self):
-self.assertRaises(
-InvalidConfig,
-configurator.validate_config,
-'validate-config',
-)
-self.assertRaises(
-InvalidRun,
-configurator.isconfigured,
-'is-configured',
-)
-# running configure with force flag to avoid validate check
-self.assertRaises(
-InvalidRun,
-configurator.configure,
-'configure',
-'--force',
-)
-self.assertRaises(
-InvalidRun,
-configurator.remove_config,
-'remove-config'
-)
-
-@ValidateRunningAsRoot
-@patchConfigurators(
-(
-MockModuleConfigurator('a'),
-MockModuleConfigurator('b'),
-)
-)
-def testValidFlowOnExposedFuncs(self):
-configurator.validate_config(
-'validate-config',
-)
-configurator.isconfigured(
-'is-configured',
-)
-configurator.configure(
-'configure',
-)
-configurator.remove_config(
-'remove-config',
-)
-
 def testConfigureFiltering(self):
 class Dummy(object):
 pass
@@ -281,6 +228,69 @@
 )
 
 
+class ExposedFunctionsTests(VdsmTestCase):
+
+@ValidateRunningAsRoot
+def setUp(self):
+configurators = {
+"a": MockModuleConfigurator("a"),
+"b": MockModuleConfigurator("b"),
+}
+self.patch = monkeypatch.Patch([
+(configurator, "_CONFIGURATORS", configurators),
+])
+self.patch.apply()
+
+def tearDown(self):
+self.patch.revert()
+
+def test_validate_config(self):
+configurator.validate_config("validate-config")
+
+def test_isconfigured(self):
+configurator.isconfigured("is-configured")
+
+def test_configure(self):
+configurator.configure("configure")
+
+def test_remove_config(self):
+configurator.remove_config("remove-config")
+
+
+class ExposedFunctionsFailuresTests(VdsmTestCase):
+
+@ValidateRunningAsRoot
+def setUp(self):
+configurators = {
+"a": MockModuleConfigurator("a", should_succeed=False),
+"b": MockModuleConfigurator("b", should_succeed=False),
+}
+self.patch = monkeypatch.Patch([
+(configurator, "_CONFIGURATORS", configurators),
+])
+self.patch.apply()
+
+def tearDown(self):
+self.patch.revert()
+
+def test_validate_config(self):
+self.assertRaises(InvalidConfig, configurator.validate_config,
+  "validate-config")
+
+def test_isconfigured(self):
+self.assertRaises(InvalidRun, configurator.isconfigured,
+  "is-configured")
+
+def test_configure(self):
+# Using --force to avoid validation
+self.assertRaises(InvalidRun, configurator.configure,
+  "configure", "--force")
+
+def test_remove_config(self):
+self.assertRaises(InvalidRun, configurator.remove_config,
+  "remove-config")
+
+
 class LibvirtModuleConfigureTests(TestCase):
 
 test_env = {}


-- 
To view, visit https://gerrit.ovirt.org/41364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id84236c1cb7ac065cec42ea08958efd8112ecbd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches