summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash_test/ash-comm/comm.right6
-rwxr-xr-xshell/ash_test/ash-comm/comm.tests20
-rw-r--r--shell/hush_test/hush-comm/comm.right6
-rwxr-xr-xshell/hush_test/hush-comm/comm.tests20
4 files changed, 52 insertions, 0 deletions
diff --git a/shell/ash_test/ash-comm/comm.right b/shell/ash_test/ash-comm/comm.right
new file mode 100644
index 000000000..1d836656f
--- /dev/null
+++ b/shell/ash_test/ash-comm/comm.right
@@ -0,0 +1,6 @@
+./SCRIPT.sh:
+ /proc/N/comm: SCRIPT.sh
+exec ./SCRIPT.sh:
+ /proc/N/comm: SCRIPT.sh
+sh ./SCRIPT.sh:
+ /proc/N/comm: ash
diff --git a/shell/ash_test/ash-comm/comm.tests b/shell/ash_test/ash-comm/comm.tests
new file mode 100755
index 000000000..671bfc176
--- /dev/null
+++ b/shell/ash_test/ash-comm/comm.tests
@@ -0,0 +1,20 @@
+{
+echo "#!$THIS_SH"
+echo 'procdir=/proc/$$'
+#echo 'echo " /proc/N/exe: $(basename $(readlink $procdir/exe))"'
+echo 'echo " /proc/N/comm: $(cat $procdir/comm)"'
+} >SCRIPT.sh
+chmod 755 SCRIPT.sh
+
+# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
+echo './SCRIPT.sh:'
+./SCRIPT.sh
+
+# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
+echo 'exec ./SCRIPT.sh:'
+(exec ./SCRIPT.sh)
+
+echo 'sh ./SCRIPT.sh:'
+$THIS_SH ./SCRIPT.sh
+
+rm SCRIPT.sh
diff --git a/shell/hush_test/hush-comm/comm.right b/shell/hush_test/hush-comm/comm.right
new file mode 100644
index 000000000..1b62b617e
--- /dev/null
+++ b/shell/hush_test/hush-comm/comm.right
@@ -0,0 +1,6 @@
+./SCRIPT.sh:
+ /proc/N/comm: SCRIPT.sh
+exec ./SCRIPT.sh:
+ /proc/N/comm: SCRIPT.sh
+sh ./SCRIPT.sh:
+ /proc/N/comm: hush
diff --git a/shell/hush_test/hush-comm/comm.tests b/shell/hush_test/hush-comm/comm.tests
new file mode 100755
index 000000000..671bfc176
--- /dev/null
+++ b/shell/hush_test/hush-comm/comm.tests
@@ -0,0 +1,20 @@
+{
+echo "#!$THIS_SH"
+echo 'procdir=/proc/$$'
+#echo 'echo " /proc/N/exe: $(basename $(readlink $procdir/exe))"'
+echo 'echo " /proc/N/comm: $(cat $procdir/comm)"'
+} >SCRIPT.sh
+chmod 755 SCRIPT.sh
+
+# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
+echo './SCRIPT.sh:'
+./SCRIPT.sh
+
+# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
+echo 'exec ./SCRIPT.sh:'
+(exec ./SCRIPT.sh)
+
+echo 'sh ./SCRIPT.sh:'
+$THIS_SH ./SCRIPT.sh
+
+rm SCRIPT.sh