|
|
@ -386,15 +386,15 @@ class TestDirectoryProcessor:
|
|
|
|
+ ";\n};\n"))
|
|
|
|
+ ";\n};\n"))
|
|
|
|
|
|
|
|
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/file_2'))
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/file_2'))
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/._cfg0001_file_2'))
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/._cfg0000_file_2'))
|
|
|
|
|
|
|
|
|
|
|
|
test_package = Package(new_package_name, chroot_path=CHROOT_PATH)
|
|
|
|
test_package = Package(new_package_name, chroot_path=CHROOT_PATH)
|
|
|
|
assert '/etc/file_2' in test_package
|
|
|
|
assert '/etc/file_2' in test_package
|
|
|
|
with open(join_paths(CHROOT_PATH,
|
|
|
|
with open(join_paths(CHROOT_PATH,
|
|
|
|
'/etc/._cfg0001_file_2'), 'r') as output_file:
|
|
|
|
'/etc/._cfg0000_file_2'), 'r') as output_file:
|
|
|
|
output_file_text = output_file.read()
|
|
|
|
output_file_text = output_file.read()
|
|
|
|
assert output_file_text == output_text
|
|
|
|
assert output_file_text == output_text
|
|
|
|
assert test_package.check_contents_data('/etc/._cfg0001_file_2',
|
|
|
|
assert test_package.check_contents_data('/etc/._cfg0000_file_2',
|
|
|
|
hashlib.md5(
|
|
|
|
hashlib.md5(
|
|
|
|
output_text.encode()).hexdigest())
|
|
|
|
output_text.encode()).hexdigest())
|
|
|
|
|
|
|
|
|
|
|
@ -426,15 +426,15 @@ class TestDirectoryProcessor:
|
|
|
|
+ ";\n};\n"))
|
|
|
|
+ ";\n};\n"))
|
|
|
|
|
|
|
|
|
|
|
|
assert not os.path.exists(join_paths(CHROOT_PATH, '/etc/file_3'))
|
|
|
|
assert not os.path.exists(join_paths(CHROOT_PATH, '/etc/file_3'))
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/._cfg0001_file_3'))
|
|
|
|
assert os.path.exists(join_paths(CHROOT_PATH, '/etc/._cfg0000_file_3'))
|
|
|
|
|
|
|
|
|
|
|
|
test_package = Package(new_package_name, chroot_path=CHROOT_PATH)
|
|
|
|
test_package = Package(new_package_name, chroot_path=CHROOT_PATH)
|
|
|
|
assert '/etc/file_3' in test_package
|
|
|
|
assert '/etc/file_3' in test_package
|
|
|
|
with open(join_paths(CHROOT_PATH,
|
|
|
|
with open(join_paths(CHROOT_PATH,
|
|
|
|
'/etc/._cfg0001_file_3'), 'r') as output_file:
|
|
|
|
'/etc/._cfg0000_file_3'), 'r') as output_file:
|
|
|
|
output_file_text = output_file.read()
|
|
|
|
output_file_text = output_file.read()
|
|
|
|
assert output_file_text == output_text
|
|
|
|
assert output_file_text == output_text
|
|
|
|
assert test_package.check_contents_data('/etc/._cfg0001_file_3',
|
|
|
|
assert test_package.check_contents_data('/etc/._cfg0000_file_3',
|
|
|
|
hashlib.md5(
|
|
|
|
hashlib.md5(
|
|
|
|
output_text.encode()).hexdigest())
|
|
|
|
output_text.encode()).hexdigest())
|
|
|
|
|
|
|
|
|
|
|
@ -974,8 +974,8 @@ class TestDirectoryProcessor:
|
|
|
|
def test_if_templates_contain_a_template_file_with_a_target_path_to_a_file_with_some_cfg_files_and_changes_in_the_template_is_the_same_as_in_the_last_cfg_file__the_directory_processor_does_nothing(self):
|
|
|
|
def test_if_templates_contain_a_template_file_with_a_target_path_to_a_file_with_some_cfg_files_and_changes_in_the_template_is_the_same_as_in_the_last_cfg_file__the_directory_processor_does_nothing(self):
|
|
|
|
datavars.main['cl_template_path'] = os.path.join(CHROOT_PATH,
|
|
|
|
datavars.main['cl_template_path'] = os.path.join(CHROOT_PATH,
|
|
|
|
'templates_28')
|
|
|
|
'templates_28')
|
|
|
|
cfg_path_1 = os.path.join(CHROOT_PATH, 'etc/._cfg0001_file_12')
|
|
|
|
cfg_path_1 = os.path.join(CHROOT_PATH, 'etc/._cfg0000_file_12')
|
|
|
|
cfg_path_2 = os.path.join(CHROOT_PATH, 'etc/._cfg0002_file_12')
|
|
|
|
cfg_path_2 = os.path.join(CHROOT_PATH, 'etc/._cfg0001_file_12')
|
|
|
|
|
|
|
|
|
|
|
|
directory_processor = DirectoryProcessor('install',
|
|
|
|
directory_processor = DirectoryProcessor('install',
|
|
|
|
datavars_module=datavars)
|
|
|
|
datavars_module=datavars)
|
|
|
|