aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-10-22 01:06:38 +0700
committerShulhan <ms@kilabit.info>2023-10-22 01:32:42 +0700
commitfc7cd444e7d637c291a3f9ba9987ba0335af4809 (patch)
treef1a32b5081417a1d64fe2cf88345ecf4494d3f97 /testdata
parent4411ca1953c95ddc013e47c55e87303b7290e2cc (diff)
downloadawwan-fc7cd444e7d637c291a3f9ba9987ba0335af4809.tar.xz
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.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/local/local.aww6
-rw-r--r--testdata/local/local_test.data13
-rw-r--r--testdata/play/awwanssh.test/play.aww5
-rw-r--r--testdata/play/awwanssh.test/play_test.data13
4 files changed, 37 insertions, 0 deletions
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