From 03c40ed68ce10b26a5f9f509e914b1b54f060215 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 4 Sep 2021 15:41:41 +0300 Subject: Add --backlink, --dangling, and --recursive options to cfg-info --- tests/cfg-link.testscript | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'tests/cfg-link.testscript') 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/ -- cgit v1.1