diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-04 15:41:41 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-06 11:53:45 +0300 |
commit | 03c40ed68ce10b26a5f9f509e914b1b54f060215 (patch) | |
tree | 42e79327baa90f4cfdee1ba04dba98250293fcfd /tests/cfg-link.testscript | |
parent | 22165c649ca2c5ef216ae3f99fbfb2dc0fff99ab (diff) |
Add --backlink, --dangling, and --recursive options to cfg-info
Diffstat (limited to 'tests/cfg-link.testscript')
-rw-r--r-- | tests/cfg-link.testscript | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/tests/cfg-link.testscript b/tests/cfg-link.testscript index 26496eb..091d2f0 100644 --- a/tests/cfg-link.testscript +++ b/tests/cfg-link.testscript @@ -17,7 +17,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' $cfg_create -d cfg --name 'main'; $cfg_create -d acfg --name 'shared' --uuid "$acfg_uuid" &acfg/***; - # Try to link configuration under the same name. + # Try to link self configuration. # $* cfg 2>>/~"%EOE%" != 0; %error: linking configuration .+/cfg/ with itself% @@ -53,8 +53,11 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' name: shared EOO - $pkg_status -d cfg libfoo >'libfoo unknown'; - $pkg_status -d acfg libfoo >'libfoo unknown'; + $cfg_info -d cfg2 --backlink >>/"EOO"; + path: $~/cfg2/ + uuid: $uuid2 + type: target + name: shared # Test that the recreated configuration can be implicitly re-linked. # @@ -76,9 +79,17 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' %error: configuration with uuid .{36} is already linked as \.\./acfg/% EOE - rm -r acfg; + # Test that the integrity check fails. + # + mv acfg acfg.tmp; - $cfg_create -d acfg --name 'shared' &acfg/***; + $cfg_create -d acfg --name 'shared'; + + $pkg_status -d cfg libfoo 2>>/~"%EOE%" != 0; + error: configuration acfg/ uuid mismatch + % info: uuid .+% + info: linked with cfg/ as $acfg_uuid + EOE # Test that the path clash is reported. # @@ -95,6 +106,8 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' info: consider specifying alternative name with --name EOE + # Link the second configuration. + # $* acfg2 2>>/~%EOE%; warning: configuration with name shared is already linked as ../acfg/, linking as unnamed %linked with configuration .+/acfg2/% @@ -103,18 +116,17 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' id: 2 EOE - # Test that the integrity check fails. + # Restore the integrity. # - $pkg_status -d cfg libfoo 2>>/~"%EOE%" != 0; + + $cfg_info -d cfg >- 2>>/~%EOE% != 0; error: configuration acfg/ uuid mismatch - % info: uuid .+% - info: linked with cfg/ as $acfg_uuid + % info: uuid .{36}% + % info: linked with cfg/ as .{36}% EOE - # Link the second configuration. - # rm -r acfg; - $cfg_create -d acfg --name 'shared' --uuid "$acfg_uuid" &acfg/***; + mv acfg.tmp acfg; $cfg_info -d cfg >>/~"%EOO%"; path: $~/cfg/ |