From fc7cd444e7d637c291a3f9ba9987ba0335af4809 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 22 Oct 2023 01:06:38 +0700 Subject: all: add magic command "#local" The magic command "#local" define the command to be executed using shell in local environment. Its have effect and can only be used in script that executed using "play". In script that is executed using "local" it does nothing. --- testdata/local/local.aww | 6 ++++++ testdata/local/local_test.data | 13 +++++++++++++ testdata/play/awwanssh.test/play.aww | 5 +++++ testdata/play/awwanssh.test/play_test.data | 13 +++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 testdata/local/local.aww create mode 100644 testdata/local/local_test.data create mode 100644 testdata/play/awwanssh.test/play.aww create mode 100644 testdata/play/awwanssh.test/play_test.data (limited to 'testdata') diff --git a/testdata/local/local.aww b/testdata/local/local.aww new file mode 100644 index 0000000..3ee69f4 --- /dev/null +++ b/testdata/local/local.aww @@ -0,0 +1,6 @@ +echo "hello" + +## Should do nothing. +#local: echo "nothing" + +echo "local" diff --git a/testdata/local/local_test.data b/testdata/local/local_test.data new file mode 100644 index 0000000..1901f11 --- /dev/null +++ b/testdata/local/local_test.data @@ -0,0 +1,13 @@ +Test on "local" command. + +<<< local:stdout + +--> local: 1: echo "hello" +hello + +--> local: 4: #local: echo "nothing" + +--> local: 6: echo "local" +local + +<<< local:stderr diff --git a/testdata/play/awwanssh.test/play.aww b/testdata/play/awwanssh.test/play.aww new file mode 100644 index 0000000..c0f13ad --- /dev/null +++ b/testdata/play/awwanssh.test/play.aww @@ -0,0 +1,5 @@ +## Should print working directory on remote server. +pwd + +## Should print working directory on local. +#local: pwd diff --git a/testdata/play/awwanssh.test/play_test.data b/testdata/play/awwanssh.test/play_test.data new file mode 100644 index 0000000..764122b --- /dev/null +++ b/testdata/play/awwanssh.test/play_test.data @@ -0,0 +1,13 @@ +Test on "play" command. + +<<< play_with_local:stdout +--- SSH connection: awwanssh@127.0.0.1:10022 +--- SSH identity file: [/home/awwan/.ssh/id_ed25519] + +--> awwanssh@127.0.0.1:10022: 2: pwd +/home/awwanssh + +--> awwanssh@127.0.0.1:10022: 5: #local: pwd +/home/awwan/src + +<<< play_with_local:stderr -- cgit v1.3