summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-19 19:49:11 +0100
committerGitHub <noreply@github.com>2017-11-19 19:49:11 +0100
commit0133d5553a1b24185f251ebbc4d873606118780f (patch)
treea226c702e98793585741d7c0183c631e419ec12a /test
parentMerge pull request #7379 from yuwata/follow-up-7309 (diff)
parentupdate TODO (diff)
downloadsystemd-0133d5553a1b24185f251ebbc4d873606118780f.tar.xz
systemd-0133d5553a1b24185f251ebbc4d873606118780f.zip
Merge pull request #7198 from poettering/stdin-stdout
Add StandardInput=data, StandardInput=file:... and more
Diffstat (limited to 'test')
-rw-r--r--test/meson.build2
-rw-r--r--test/test-execute/exec-stdin-data.service19
-rw-r--r--test/test-execute/exec-stdio-file.service7
3 files changed, 28 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index a621f5db52..40605b385f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -111,6 +111,8 @@ test_data_files = '''
test-execute/exec-runtimedirectory.service
test-execute/exec-spec-interpolation.service
test-execute/exec-specifier.service
+ test-execute/exec-stdin-data.service
+ test-execute/exec-stdio-file.service
test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
test-execute/exec-supplementarygroups-multiple-groups-withgid.service
test-execute/exec-supplementarygroups-multiple-groups-withuid.service
diff --git a/test/test-execute/exec-stdin-data.service b/test/test-execute/exec-stdin-data.service
new file mode 100644
index 0000000000..1ca536ffc5
--- /dev/null
+++ b/test/test-execute/exec-stdin-data.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Test for StandardInputText= and StandardInputData=
+
+[Service]
+ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" > $d/text ; cmp $d/text ; rm -rf $d'
+Type=oneshot
+StandardInput=data
+StandardInputText=this is a test
+StandardInputText=and this is more
+StandardInputData=c29tZXRoaW5nIGVuY29kZWQhCg==
+StandardInputText=something \
+ in multiple lines
+StandardInputText=\
+and some more
+StandardInputData=YW5kIGEgbW9y \
+ ZSBiYXM2NCBk\
+YXRhCg==
+StandardInputText=something with strange\nembedded\tcharacters
+StandardInputText=and something with a %n specifier
diff --git a/test/test-execute/exec-stdio-file.service b/test/test-execute/exec-stdio-file.service
new file mode 100644
index 0000000000..8fd11caf8e
--- /dev/null
+++ b/test/test-execute/exec-stdio-file.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test for StandardInput=file:
+
+[Service]
+ExecStart=/usr/bin/cmp /usr/bin/cmp
+Type=oneshot
+StandardInput=file:/usr/bin/cmp