-# @skipIfNotPLCredentials
-# def test_provision_more_than_available(self):
-# """
-# Check that if the user wants to provision 3 nodes in Paris, he
-# gets RuntimeError, there are only 2 nodes with city=Paris.
-# """
-# node1 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# city="Paris", operatingSystem="f12")
-#
-# plnode_rm1 = self.ec.get_resource(node1)
-#
-# api = plnode_rm.plapi
-# api.add_slice_nodes(self.username, ['nepi2.pl.sophia.inria.fr'])
-#
-# plnode_rm1.do_discover()
-# plnode_rm1.do_provision()
-#
-# node2 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# city="Paris", operatingSystem="f12")
-#
-# plnode_rm2 = self.ec.get_resource(node2)
-# plnode_rm2.do_discover()
-# plnode_rm2.do_provision()
-#
-# node3 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# city="Paris", operatingSystem="f12")
-#
-# plnode_rm3 = self.ec.get_resource(node3)
-# with self.assertRaises(RuntimeError):
-# plnode_rm3.do_discover()
-# with self.assertRaises(RuntimeError):
-# plnode_rm3.do_provision()
-#
-# host1 = plnode_rm1.get('hostname')
-#
-# plnode_rm3._set_hostname_attr(host1)
-#
-# @skipIfNotPLCredentials
-# def test_concurrence(self):
-# """
-# Test with the nodes being discover and provision at the same time.
-# It should fail as the test before.
-# """
-# node1 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# architecture="x86_64", operatingSystem="f12")
-#
-# node2 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# architecture="x86_64", operatingSystem="f12")
-#
-# node3 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# architecture="x86_64", operatingSystem="f12")
-#
-# node4 = create_node(self.ec, self.username, pl_user=self.pl_user,
-# pl_password=self.pl_password, pl_url=self.pl_url,
-# architecture="x86_64", operatingSystem="f12")
-#
-# self.ec.deploy()
-# self.ec.wait_finished([node1, node2, node3, node4])
-# state = self.ec.state(node1, hr=True)
-# self.assertIn(state, ['READY', 'FAILED'])
-# state = self.ec.state(node2, hr=True)
-# self.assertIn(state, ['READY', 'FAILED'])
-# state = self.ec.state(node3, hr=True)
-# self.assertIn(state, ['READY', 'FAILED'])
-# state = self.ec.state(node4, hr=True)
-# self.assertIn(state, ['READY', 'FAILED'])
+ @skipIfNotPLCredentials
+ def test_provision_more_than_available(self):
+ """
+ Check that if the user wants to provision 3 nodes in Paris, he
+ gets RuntimeError, there are only 2 nodes with city=Paris.
+ """
+ node1 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ city="Paris", operatingSystem="f12")
+
+ plnode_rm1 = self.ec.get_resource(node1)
+ plnode_rm1.do_discover()
+ plnode_rm1.do_provision()
+
+ node2 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ city="Paris", operatingSystem="f12")
+
+ plnode_rm2 = self.ec.get_resource(node2)
+ plnode_rm2.do_discover()
+ plnode_rm2.do_provision()
+
+ node3 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ city="Paris", operatingSystem="f12")
+
+ plnode_rm3 = self.ec.get_resource(node3)
+ with self.assertRaises(RuntimeError):
+ plnode_rm3.do_discover()
+ with self.assertRaises(RuntimeError):
+ plnode_rm3.do_provision()
+
+ host1 = plnode_rm1.get('hostname')
+
+ plnode_rm3._set_hostname_attr(host1)
+
+ @skipIfNotPLCredentials
+ def test_concurrence(self):
+ """
+ Test with the nodes being discover and provision at the same time.
+ The deploy should fail as the test before, there aren't 4 nodes of
+ that carachteristics.
+ """
+ node1 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ architecture="x86_64", operatingSystem="f12")
+
+ node2 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ architecture="x86_64", operatingSystem="f12")
+
+ node3 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ architecture="x86_64", operatingSystem="f12")
+
+ node4 = create_node(self.ec, self.username, pl_user=self.pl_user,
+ pl_password=self.pl_password, pl_url=self.pl_url,
+ architecture="x86_64", operatingSystem="f12")
+
+ self.ec.deploy()
+ self.ec.wait_deployed([node1, node2, node3, node4])
+ failure_level = self.ec._fm._failure_level
+ self.assertEqual(failure_level, 2)