Merge "Avoid modification into global objects"
This commit is contained in:
commit
af8929b990
|
@ -13,6 +13,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import copy
|
||||||
|
|
||||||
from bareon import tests_functional
|
from bareon import tests_functional
|
||||||
from bareon.tests_functional import utils
|
from bareon.tests_functional import utils
|
||||||
|
|
||||||
|
@ -153,19 +155,18 @@ is included with the distribution media.
|
||||||
self._assert_vdb_equal_to_goldenimage(node)
|
self._assert_vdb_equal_to_goldenimage(node)
|
||||||
|
|
||||||
def test_verify_policy_mismatch_extra_partition_in_schema(self):
|
def test_verify_policy_mismatch_extra_partition_in_schema(self):
|
||||||
self.golden_image_schema[0]["volumes"].append({
|
deploy_conf = {
|
||||||
"images": [
|
"partitions": copy.deepcopy(self.golden_image_schema),
|
||||||
"test"
|
"partitions_policy": "verify"
|
||||||
],
|
}
|
||||||
|
deploy_conf['partitions'][0]['volumes'].append({
|
||||||
|
"images": ["test"],
|
||||||
"mount": "/tmp",
|
"mount": "/tmp",
|
||||||
"type": "partition",
|
"type": "partition",
|
||||||
"file_system": "ext3",
|
"file_system": "ext3",
|
||||||
"size": "2000"
|
"size": "2000"
|
||||||
})
|
})
|
||||||
deploy_conf = {
|
|
||||||
"partitions": self.golden_image_schema,
|
|
||||||
"partitions_policy": "verify"
|
|
||||||
}
|
|
||||||
self.env.patch_config_images(deploy_conf, 'test')
|
self.env.patch_config_images(deploy_conf, 'test')
|
||||||
self.env.setup(node_template="data_retention.xml",
|
self.env.setup(node_template="data_retention.xml",
|
||||||
deploy_config=deploy_conf)
|
deploy_config=deploy_conf)
|
||||||
|
@ -187,12 +188,12 @@ is included with the distribution media.
|
||||||
self._assert_vdb_equal_to_goldenimage(node)
|
self._assert_vdb_equal_to_goldenimage(node)
|
||||||
|
|
||||||
def test_verify_policy_mismatch_extra_partition_on_hw(self):
|
def test_verify_policy_mismatch_extra_partition_on_hw(self):
|
||||||
self.golden_image_schema[0]['volumes'].pop()
|
|
||||||
|
|
||||||
deploy_conf = {
|
deploy_conf = {
|
||||||
"partitions": self.golden_image_schema,
|
"partitions": copy.deepcopy(self.golden_image_schema),
|
||||||
"partitions_policy": "verify"
|
"partitions_policy": "verify"
|
||||||
}
|
}
|
||||||
|
deploy_conf['partitions'][0]['volumes'].pop()
|
||||||
|
|
||||||
self.env.patch_config_images(deploy_conf, 'test')
|
self.env.patch_config_images(deploy_conf, 'test')
|
||||||
self.env.setup(node_template="data_retention.xml",
|
self.env.setup(node_template="data_retention.xml",
|
||||||
deploy_config=deploy_conf)
|
deploy_config=deploy_conf)
|
||||||
|
@ -214,14 +215,14 @@ is included with the distribution media.
|
||||||
self._assert_vdb_equal_to_goldenimage(node)
|
self._assert_vdb_equal_to_goldenimage(node)
|
||||||
|
|
||||||
def test_verify_policy_match_and_clean_one_of_filesystems(self):
|
def test_verify_policy_match_and_clean_one_of_filesystems(self):
|
||||||
usr_partition = self.golden_image_schema[0]['volumes'][2]
|
|
||||||
self.assertEqual('/usr', usr_partition['mount'])
|
|
||||||
usr_partition['keep_data'] = False
|
|
||||||
|
|
||||||
deploy_conf = {
|
deploy_conf = {
|
||||||
"partitions": self.golden_image_schema,
|
"partitions": copy.deepcopy(self.golden_image_schema),
|
||||||
"partitions_policy": "verify"
|
"partitions_policy": "verify"
|
||||||
}
|
}
|
||||||
|
usr_partition = deploy_conf['partitions'][0]['volumes'][2]
|
||||||
|
usr_partition['keep_data'] = False
|
||||||
|
self.assertEqual('/usr', usr_partition['mount'])
|
||||||
|
|
||||||
self.env.patch_config_images(deploy_conf, 'test')
|
self.env.patch_config_images(deploy_conf, 'test')
|
||||||
self.env.setup(node_template="data_retention.xml",
|
self.env.setup(node_template="data_retention.xml",
|
||||||
deploy_config=deploy_conf)
|
deploy_config=deploy_conf)
|
||||||
|
|
Loading…
Reference in New Issue