diff --git a/tests/templates/format/testfiles/a/dir/file1.txt b/tests/templates/format/testfiles/a/dir/file1.txt
index 023bd50..474f6f7 100644
--- a/tests/templates/format/testfiles/a/dir/file1.txt
+++ b/tests/templates/format/testfiles/a/dir/file1.txt
@@ -1,10 +1,17 @@
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y
+CONFIG_THREAD_INFO_IN_TASK=y
#
# General setup
#
+CONFIG_INIT_ENV_ARG_LIMIT=16
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
diff --git a/tests/templates/format/testfiles/a/dir/file2.txt b/tests/templates/format/testfiles/a/dir/file2.txt
index be7bbc3..acfa977 100644
--- a/tests/templates/format/testfiles/a/dir/file2.txt
+++ b/tests/templates/format/testfiles/a/dir/file2.txt
@@ -8,3 +8,9 @@ A needle tears a hole
The old familiar sting
Try to kill it all away
But I remember everything.
+
+What have I become
+My sweetest friend
+Everyone I know
+Goes away
+In the end
diff --git a/tests/templates/format/testfiles/xml_gconf_result.xml b/tests/templates/format/testfiles/xml_gconf_result.xml
index 6b9c03b..3951a4d 100644
--- a/tests/templates/format/testfiles/xml_gconf_result.xml
+++ b/tests/templates/format/testfiles/xml_gconf_result.xml
@@ -17,15 +17,15 @@
-
+
distributor
-
-
+
+
diff --git a/tests/templates/test_template_executor.py b/tests/templates/test_template_executor.py
index 0c51def..8e74c86 100644
--- a/tests/templates/test_template_executor.py
+++ b/tests/templates/test_template_executor.py
@@ -622,6 +622,8 @@ class TestTemplateExecutor:
def test_if_the_clear_directory_method_s_input_is_a_path_to_an_existing_empty_directory__the_method_does_nothing(self):
target_path = join_paths(CHROOT_PATH,
'/etc/clear_dir_testfiles/dir_0')
+ # Делаем директорию пустой.
+ os.remove(os.path.join(target_path, 'file'))
template_executor._clear_directory(target_path)
assert not os.listdir(target_path)
diff --git a/tests/templates/test_template_wrapper.py b/tests/templates/test_template_wrapper.py
index 996c351..ffabae1 100644
--- a/tests/templates/test_template_wrapper.py
+++ b/tests/templates/test_template_wrapper.py
@@ -673,19 +673,24 @@ class TestTemplateWrapper:
assert not template_wrapper.protected
def test_if_a_target_file_is_located_in_a_directory_from_the_protected_mask__the_TemplateWrapper_object_sets_the_protected_flag_as_False(self):
- parameters_object = ParametersContainer({'append': 'join',
- 'format': 'samba'})
- try:
- template_wrapper = TemplateWrapper(
- join_paths(CHROOT_PATH,
- '/etc/terminfo/info.json'),
- parameters_object, FILE,
- '/path/to/template',
- chroot_path=CHROOT_PATH,
- config_archive_path=CONFIG_ARCHIVE_PATH)
- except Exception as error:
- pytest.fail("Unexpected exception: {}".format(str(error)))
- assert not template_wrapper.protected
+ if os.environ.get('CONFIG_PROTECT', False):
+ parameters_object = ParametersContainer({'append': 'join',
+ 'format': 'samba'})
+ try:
+ template_wrapper = TemplateWrapper(
+ join_paths(CHROOT_PATH,
+ '/etc/terminfo/info.json'),
+ parameters_object, FILE,
+ '/path/to/template',
+ chroot_path=CHROOT_PATH,
+ config_archive_path=CONFIG_ARCHIVE_PATH)
+ except Exception as error:
+ pytest.fail("Unexpected exception: {}".format(str(error)))
+ print('PROTECTED SET')
+ print(template_wrapper._protected_set)
+ print('UNPROTECTED SET')
+ print(template_wrapper._unprotected_set)
+ assert not template_wrapper.protected
# Тестируем проверку хэш-сумм и флаг получаемый в результате нее.
def test_if_a_target_file_is_not_protected__the_TemplateWrapper_sets_the_md5_matching_flag_as_True(self):
diff --git a/tests/templates/testfiles/test_config_root_2/var/lib/calculate/config b/tests/templates/testfiles/test_config_root_2/var/lib/calculate/config
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_12 b/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_12
deleted file mode 100644
index 3bae35e..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_12
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /path/to/template
-#-------------------------------------------------------------------------------
-section-name {
- parameter-1 yes;
- parameter-2 no;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_2 b/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_2
deleted file mode 100644
index e9f5903..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_2
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_8/root/file_2
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_3 b/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_3
deleted file mode 100644
index b86f911..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0001_file_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_9/root/etc/file_3
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0002_file_12 b/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0002_file_12
deleted file mode 100644
index 4ade9c7..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/._cfg0002_file_12
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_28/root/file_12
-#-------------------------------------------------------------------------------
-section-name {
- parameter-1 yes;
- parameter-3 10;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_10/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_10/file_0
deleted file mode 100644
index 732a0a0..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_10/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_14/root/dir_10/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_12/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_12/file_0
deleted file mode 100644
index 362d7f5..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_12/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_16/root/dir_12/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_13/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_13/file_0
deleted file mode 100644
index cee59f8..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_13/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_17/root/dir_13/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_17 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_17
deleted file mode 120000
index 141c4b8..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_17
+++ /dev/null
@@ -1 +0,0 @@
-dir_18/
\ No newline at end of file
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_18/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_18/file_0
deleted file mode 100644
index 4bb4151..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_18/file_0
+++ /dev/null
@@ -1,3 +0,0 @@
-options {
- parameter-0 yes;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_19 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_19
deleted file mode 120000
index 2ba4a07..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_19
+++ /dev/null
@@ -1 +0,0 @@
-dir_20/
\ No newline at end of file
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_2/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_2/file_0
deleted file mode 100644
index 8ed6649..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_2/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_3/root/dir_2/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_20/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_20/file_0
deleted file mode 100644
index 4bb4151..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_20/file_0
+++ /dev/null
@@ -1,3 +0,0 @@
-options {
- parameter-0 yes;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_4/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_4/file_0
deleted file mode 100644
index 9470ef5..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_4/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_5/root/dir_4/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_5/dir_6/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_5/dir_6/file_0
deleted file mode 100644
index f5dbc4a..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_5/dir_6/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_5/root/dir_5/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_6/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_6/file_0
deleted file mode 100644
index 8264731..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_6/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_7/root/dir_6/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_7/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_7/file_0
deleted file mode 100644
index 3893407..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_7/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/dir_7/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 no;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/dir_9/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/dir_9/file_0
deleted file mode 100644
index ba36a00..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/dir_9/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_14/root/dir_9/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_0 b/tests/templates/testfiles/test_dir_processor_root/etc/file_0
deleted file mode 100644
index 87606a4..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_1/root/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_1 b/tests/templates/testfiles/test_dir_processor_root/etc/file_1
deleted file mode 100644
index fede283..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_1
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_6/root/file_1
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_12 b/tests/templates/testfiles/test_dir_processor_root/etc/file_12
deleted file mode 100644
index b441fd2..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_12
+++ /dev/null
@@ -1,3 +0,0 @@
-section-name {
- parameter-1 no;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_2 b/tests/templates/testfiles/test_dir_processor_root/etc/file_2
deleted file mode 100644
index c416be9..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_2
+++ /dev/null
@@ -1,3 +0,0 @@
-options {
- parameter-0 no;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_4 b/tests/templates/testfiles/test_dir_processor_root/etc/file_4
deleted file mode 100644
index 5032299..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_4
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/file_4
-#-------------------------------------------------------------------------------
-options {
- parameter-0 no;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_5 b/tests/templates/testfiles/test_dir_processor_root/etc/file_5
deleted file mode 100644
index 7cba6fd..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_5
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/file_5
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_6 b/tests/templates/testfiles/test_dir_processor_root/etc/file_6
deleted file mode 100644
index 98c1d76..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_6
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_12/root_0/etc/file_6
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/file_8 b/tests/templates/testfiles/test_dir_processor_root/etc/file_8
deleted file mode 100644
index 5602790..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/file_8
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_13/root/etc/dir_9/file_8
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/group b/tests/templates/testfiles/test_dir_processor_root/etc/group
deleted file mode 100644
index a81c003..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/group
+++ /dev/null
@@ -1,66 +0,0 @@
-root::0:root
-bin::1:root,bin,daemon
-daemon::2:root,bin,daemon
-sys::3:root,bin,adm
-adm::4:root,adm,daemon
-tty::5:
-disk::6:root,adm,haldaemon
-lp::7:lp,guest
-mem::8:
-kmem::9:
-wheel::10:root,guest
-floppy::11:root,haldaemon
-mail::12:mail
-news::13:news
-uucp::14:uucp,guest
-man::15:man
-console::17:
-audio::18:guest
-cdrom::19:haldaemon,guest
-dialout::20:root
-tape::26:root
-video::27:root,guest
-cdrw::80:haldaemon,guest
-usb::85:haldaemon,guest
-users::100:games,guest
-nofiles:x:200:
-smmsp:x:209:smmsp
-portage::250:portage
-utmp:x:406:
-nogroup::65533:
-nobody::65534:
-sshd:x:22:
-games:x:35:guest
-plugdev:x:440:haldaemon,usbmux,guest
-scanner:x:441:guest
-ldap:x:439:
-messagebus:x:199:
-lpadmin:x:106:
-polkituser:x:105:
-cron:x:16:
-ntp:x:123:
-rpc:x:111:
-fingerprint:x:104:
-ssmtp:x:103:
-crontab:x:102:
-gdm:x:101:
-haldaemon:x:999:haldaemon
-openvpn:x:998:
-vnstat:x:997:
-dnsmasq:x:996:
-polkitd:x:995:
-locate:x:994:
-input:x:993:
-dhcp:x:992:
-mysql:x:60:
-netdev:x:991:
-avahi:x:990:
-avahi-autoipd:x:989:
-nm-openvpn:x:988:
-deluge:x:987:
-postgres:x:70:
-nullmail:x:88:
-sudo:x:443:
-kvm:x:78:
-render:x:28:
-guest:!:1000:
diff --git a/tests/templates/testfiles/test_dir_processor_root/etc/passwd b/tests/templates/testfiles/test_dir_processor_root/etc/passwd
deleted file mode 100644
index 5d61d91..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/etc/passwd
+++ /dev/null
@@ -1,42 +0,0 @@
-root:x:0:0:root:/root:/bin/bash
-bin:x:1:1:bin:/bin:/bin/false
-daemon:x:2:2:daemon:/sbin:/bin/false
-adm:x:3:4:adm:/var/adm:/bin/false
-lp:x:4:7:lp:/var/spool/lpd:/bin/false
-sync:x:5:0:sync:/sbin:/bin/sync
-shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
-halt:x:7:0:halt:/sbin:/sbin/halt
-mail:x:8:12:Mail program user:/var/spool/mail:/sbin/nologin
-news:x:9:13:news:/usr/lib/news:/bin/false
-uucp:x:10:14:uucp:/var/spool/uucppublic:/bin/false
-operator:x:11:0:operator:/root:/bin/bash
-man:x:13:15:man:/usr/share/man:/bin/false
-postmaster:x:14:12:Postmaster user:/var/spool/mail:/sbin/nologin
-portage:x:250:250:portage:/var/tmp/portage:/bin/false
-nobody:x:65534:65534:nobody:/:/bin/false
-sshd:x:22:22:added by portage for openssh:/var/empty:/sbin/nologin
-ldap:x:439:439:added by portage for openldap:/usr/lib64/openldap:/sbin/nologin
-messagebus:x:101:199:System user; messagebus:/dev/null:/sbin/nologin
-polkituser:x:102:105:added by portage for polkit:/dev/null:/sbin/nologin
-cron:x:16:16:added by portage for cronbase:/var/spool/cron:/sbin/nologin
-ntp:x:123:123:added by portage for ntp:/dev/null:/sbin/nologin
-rpc:x:111:111:added by portage for portmap:/dev/null:/sbin/nologin
-gdm:x:103:101:added by portage for gdm:/var/lib/gdm:/sbin/nologin
-haldaemon:x:104:999:added by portage for hal:/dev/null:/sbin/nologin
-openvpn:x:105:998:added by portage for openvpn:/dev/null:/sbin/nologin
-usbmux:x:106:85:added by portage for usbmuxd:/dev/null:/sbin/nologin
-vnstat:x:107:997:added by portage for vnstat:/dev/null:/sbin/nologin
-dnsmasq:x:108:996:added by portage for dnsmasq:/dev/null:/sbin/nologin
-polkitd:x:109:995:added by portage for polkit:/var/lib/polkit-1:/sbin/nologin
-saned:x:110:441:added by portage for sane-backends:/dev/null:/sbin/nologin
-dhcp:x:112:992:added by portage for dhcp:/var/lib/dhcp:/sbin/nologin
-mysql:x:60:60:added by portage for mysql:/dev/null:/sbin/nologin
-avahi:x:113:990:added by portage for avahi:/dev/null:/sbin/nologin
-avahi-autoipd:x:114:989:added by portage for avahi:/dev/null:/sbin/nologin
-nm-openvpn:x:115:988:added by portage for networkmanager-openvpn:/dev/null:/sbin/nologin
-games:x:36:35:added by portage for games-envd:/usr/games:/bin/bash
-deluge:x:116:987:added by portage for deluge:/var/lib/deluge:/sbin/nologin
-postgres:x:70:70:added by portage for postgresql:/var/lib/postgresql:/bin/sh
-nullmail:x:88:88:added by portage for nullmailer:/var/nullmailer:/sbin/nologin
-divanov:x:1427:1000::/home/denis:/bin/bash
-guest:x:1000:1000::/home/guest:/bin/bash
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/new-package-0.1.1/CONTENTS b/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/new-package-0.1.1/CONTENTS
deleted file mode 100644
index 9c13899..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/new-package-0.1.1/CONTENTS
+++ /dev/null
@@ -1,12 +0,0 @@
-dir /etc
-obj /etc/file_1 823bb8dc6fdf14449714181a729374a9 1594219444
-obj /etc/file_2 178094df387d2f5c2a3516a81fe760de 1594219445
-obj /etc/file_3 ed2b41fe5b2e68ad3a974e0b8f9cc99a 1594219445
-obj /etc/file_4 da04b7769f94c9702c0edcb8bba4770c 1594219445
-dir /etc/dir_6
-obj /etc/dir_6/file_0 e6977bce3e6edd818bb72f324a2a74f3 1594219444
-obj /etc/dir_7/file_0 664c77aaf2d358d227db03545b083ea3 1594219446
-dir /etc/dir_12
-obj /etc/dir_12/file_0 a9109c66e7ec71c12bb2d45273f2c46d 1594219447
-obj /etc/file_5 916eec267d08950072369b69c10a99ae 1594219445
-dir /etc/dir_7
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/other-package-1.1/CONTENTS b/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/other-package-1.1/CONTENTS
deleted file mode 100644
index d01e1e9..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/other-package-1.1/CONTENTS
+++ /dev/null
@@ -1,3 +0,0 @@
-dir /etc
-dir /etc/dir_9
-obj /etc/dir_9/file_0 78373bda3f7f86f54ca25724291a5492 1594219446
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/test-package-1.0/CONTENTS b/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/test-package-1.0/CONTENTS
deleted file mode 100644
index 2824015..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/db/pkg/test-category/test-package-1.0/CONTENTS
+++ /dev/null
@@ -1,18 +0,0 @@
-dir /etc
-dir /etc/dir_17
-obj /etc/dir_17/file_0 c585be6f171462940b44af994a54040d 1593525253
-dir /etc/dir_17/dir_0
-obj /etc/dir_17/dir_0/file_0 c585be6f171462940b44af994a54040d 1593525253
-obj /etc/file_12 ee090b452dbf92d697124eb424f5de5b 1592574626
-obj /etc/file_0 d8047d1de0f84955782fb17d9172c283 1594219443
-dir /etc/dir_2
-obj /etc/dir_2/file_0 4d87707225fe92339257baad74d26220 1594219443
-dir /etc/dir_4
-obj /etc/dir_4/file_0 2760f4fa242d649cc32b7c27926b5bf9 1594219444
-dir /etc/dir_5
-dir /etc/dir_5/dir_6
-obj /etc/dir_5/dir_6/file_0 c5f1a785f8e5f4af46c74afcb7c2efcc 1594219444
-obj /etc/file_6 8ad8eb73b5f86ee77c2f4a89f61a5899 1594219446
-obj /etc/file_8 ada08a4f77c8181fa33cac4aa39b2843 1594219446
-dir /etc/dir_10
-obj /etc/dir_10/file_0 454438a905c36213ec67d2a61b855daa 1594219447
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/.config.swo b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/.config.swo
deleted file mode 100644
index 01e1a35..0000000
Binary files a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/.config.swo and /dev/null differ
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config
deleted file mode 100644
index 37c7054..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config
+++ /dev/null
@@ -1 +0,0 @@
-/etc/file_12 da971af62bcd1bf533851f69a2780bf7
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_10/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_10/file_0
deleted file mode 100644
index 732a0a0..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_10/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_14/root/dir_10/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_12/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_12/file_0
deleted file mode 100644
index 362d7f5..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_12/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_16/root/dir_12/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_2/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_2/file_0
deleted file mode 100644
index 8ed6649..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_2/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_3/root/dir_2/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_4/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_4/file_0
deleted file mode 100644
index 9470ef5..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_4/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_5/root/dir_4/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_5/dir_6/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_5/dir_6/file_0
deleted file mode 100644
index f5dbc4a..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_5/dir_6/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_5/root/dir_5/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_6/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_6/file_0
deleted file mode 100644
index 8264731..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_6/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_7/root/dir_6/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_7/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_7/file_0
deleted file mode 100644
index 3893407..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_7/file_0
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/dir_7/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-0 no;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_9/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_9/file_0
deleted file mode 100644
index ba36a00..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/dir_9/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_14/root/dir_9/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_0 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_0
deleted file mode 100644
index 87606a4..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_0
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_1/root/file_0
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_1 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_1
deleted file mode 100644
index fede283..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_1
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_6/root/file_1
-#-------------------------------------------------------------------------------
-options {
- parameter-0 yes;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_12 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_12
deleted file mode 100644
index b441fd2..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_12
+++ /dev/null
@@ -1,3 +0,0 @@
-section-name {
- parameter-1 no;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_2 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_2
deleted file mode 100644
index 4bb4151..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_2
+++ /dev/null
@@ -1,3 +0,0 @@
-options {
- parameter-0 yes;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_4 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_4
deleted file mode 100644
index 5032299..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_4
+++ /dev/null
@@ -1,10 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/file_4
-#-------------------------------------------------------------------------------
-options {
- parameter-0 no;
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_5 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_5
deleted file mode 100644
index 7cba6fd..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_5
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_10/root/etc/file_5
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_6 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_6
deleted file mode 100644
index 98c1d76..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_6
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_12/root_0/etc/file_6
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_8 b/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_8
deleted file mode 100644
index 5602790..0000000
--- a/tests/templates/testfiles/test_dir_processor_root/var/lib/calculate/config-archive/etc/file_8
+++ /dev/null
@@ -1,9 +0,0 @@
-#-------------------------------------------------------------------------------
-# Modified by Calculate Utilities 4.0
-# Processed template files:
-# /home/divanov/Home/development/calculate-lib/tests/templates/testfiles/test_dir_processor_root/templates_13/root/etc/dir_9/file_8
-#-------------------------------------------------------------------------------
-options {
- parameter-1 value_1;
- parameter-2 value_2;
-};
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_clear_dir_testfiles/dir_0/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_clear_dir_testfiles/dir_0/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_join_dir_testfiles/dir_1/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_join_dir_testfiles/dir_1/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_join_file_testfiles/dir_16/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_join_file_testfiles/dir_16/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_0/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_0/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_1/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_1/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_2/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_2/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_3/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_3/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_4/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_4/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_5/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_5/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_6/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_link_dir_testfiles/dir_6/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_executor_root/etc.backup/append_remove_dir_testfiles/dir_2/file b/tests/templates/testfiles/test_executor_root/etc.backup/append_remove_dir_testfiles/dir_2/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_wrapper_root/etc/dir/dir_2/file b/tests/templates/testfiles/test_wrapper_root/etc/dir/dir_2/file
new file mode 100644
index 0000000..e69de29
diff --git a/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS b/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS
index aad0da2..a2ea5d3 100644
--- a/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS
+++ b/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS
@@ -6,6 +6,6 @@ obj /etc/dir/deleted.json 11e3a79fe51cce828d973dba8702adaa 1591356795
dir /etc/dir/subdir
obj /etc/dir/subdir/config.json 506649cf099878124deda2c2452c3693 1591605050
obj /etc/dir/subdir/file 84bcceb2c8e6de79849ea5f3304f2411 1591343236
-obj /etc/dir/file.conf 0b87fea7f5b65cac5012baa2bf647e72 1591196541
+obj /etc/dir/file.conf 0b87fea7f5b65cac5012baa2bf647e72 1594324832
dir /etc/dir/dir_1
-obj /etc/dir/dir_1/config.json 506649cf099878124deda2c2452c3693 1591617024
+obj /etc/dir/dir_1/config.json 506649cf099878124deda2c2452c3693 1594324832
diff --git a/tests/utils/test_files.py b/tests/utils/test_files.py
index 16e78d7..e93ed82 100644
--- a/tests/utils/test_files.py
+++ b/tests/utils/test_files.py
@@ -1,14 +1,19 @@
import pytest
+import os
from calculate.utils.files import Process
from subprocess import run, PIPE
+CHROOT_PATH = os.path.join(os.getcwd(), 'tests/utils/testfiles/')
+
+
@pytest.mark.files_utils
class TestUtils():
def test_if_single_correct_command_executed_using_Process_object__it_successfully_executes(self):
+ ls_path = os.path.join(CHROOT_PATH, 'etc')
try:
- ls_process = Process('ls', '-a', cwd='/')
- ls_result = run('ls -a', shell=True, stdout=PIPE, cwd='/')
+ ls_process = Process('ls', '-a', cwd=ls_path)
+ ls_result = run('ls -a', shell=True, stdout=PIPE, cwd=ls_path)
except Exception as error:
print('error:', str(error))
assert False
diff --git a/tests/utils/test_package.py b/tests/utils/test_package.py
index e4859fd..ec102bc 100644
--- a/tests/utils/test_package.py
+++ b/tests/utils/test_package.py
@@ -107,8 +107,10 @@ obj /usr/bin/vim 30acc0f256e11c1ecdb1bd80b688d238 1573538056
sym /usr/bin/vimdiff -> vim 1573538053
dir /etc
dir /etc/test_dir_2
-obj /etc/test_dir_2/file_2.cfg a371f4d456d471ac0ed0e8befff1cb6d 1586531028
-'''
+obj /etc/test_dir_2/file_2.cfg a371f4d456d471ac0ed0e8befff1cb6d {}
+'''.format(int(os.lstat(os.path.join(CHROOT_PATH,
+ 'etc/test_dir_2/file_2.cfg')).st_mtime))
+
contents_object.add_obj('/etc/test_dir_2/file_2.cfg')
print('RESULT:')
print(contents_object.render_contents_file())
@@ -125,8 +127,10 @@ obj /usr/bin/vim 30acc0f256e11c1ecdb1bd80b688d238 1573538056
sym /usr/bin/vimdiff -> vim 1573538053
dir /etc
dir /etc/test_dir_2
-sym /etc/test_dir_2/symlink -> file_2.cfg 1587117567
-'''
+sym /etc/test_dir_2/symlink -> file_2.cfg {}
+'''.format(int(os.lstat(os.path.join(CHROOT_PATH,
+ 'etc/test_dir_2/symlink')).st_mtime))
+
contents_object.add_sym('/etc/test_dir_2/symlink')
print('RESULT:')
print(contents_object.render_contents_file())