Merge "Avoid modification into global objects"

This commit is contained in:
Jenkins 2017-02-07 14:51:39 +00:00 committed by Gerrit Code Review
commit af8929b990
1 changed files with 17 additions and 16 deletions

View File

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
from bareon import tests_functional
from bareon.tests_functional import utils
@ -153,19 +155,18 @@ is included with the distribution media.
self._assert_vdb_equal_to_goldenimage(node)
def test_verify_policy_mismatch_extra_partition_in_schema(self):
self.golden_image_schema[0]["volumes"].append({
"images": [
"test"
],
deploy_conf = {
"partitions": copy.deepcopy(self.golden_image_schema),
"partitions_policy": "verify"
}
deploy_conf['partitions'][0]['volumes'].append({
"images": ["test"],
"mount": "/tmp",
"type": "partition",
"file_system": "ext3",
"size": "2000"
})
deploy_conf = {
"partitions": self.golden_image_schema,
"partitions_policy": "verify"
}
self.env.patch_config_images(deploy_conf, 'test')
self.env.setup(node_template="data_retention.xml",
deploy_config=deploy_conf)
@ -187,12 +188,12 @@ is included with the distribution media.
self._assert_vdb_equal_to_goldenimage(node)
def test_verify_policy_mismatch_extra_partition_on_hw(self):
self.golden_image_schema[0]['volumes'].pop()
deploy_conf = {
"partitions": self.golden_image_schema,
"partitions": copy.deepcopy(self.golden_image_schema),
"partitions_policy": "verify"
}
deploy_conf['partitions'][0]['volumes'].pop()
self.env.patch_config_images(deploy_conf, 'test')
self.env.setup(node_template="data_retention.xml",
deploy_config=deploy_conf)
@ -214,14 +215,14 @@ is included with the distribution media.
self._assert_vdb_equal_to_goldenimage(node)
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 = {
"partitions": self.golden_image_schema,
"partitions": copy.deepcopy(self.golden_image_schema),
"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.setup(node_template="data_retention.xml",
deploy_config=deploy_conf)