-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 Nerves Project Developers | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Script | ||
# | ||
|
||
cat >$WORK/etc/my_serial <<EOF | ||
#!/bin/sh | ||
printf "12345678" | ||
EOF | ||
chmod +x $WORK/etc/my_serial | ||
|
||
CMDLINE="-b script -f $WORK/etc/my_serial" | ||
|
||
cat >$EXPECTED <<EOF | ||
12345678 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 Nerves Project Developers | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Script that outputs the serial number in pieces | ||
# | ||
|
||
cat >$WORK/etc/my_serial <<EOF | ||
#!/bin/sh | ||
printf "1" | ||
printf "2" | ||
printf "3" | ||
printf "4" | ||
printf "5" | ||
printf "6" | ||
printf "7" | ||
printf "8" | ||
EOF | ||
chmod +x $WORK/etc/my_serial | ||
|
||
CMDLINE="-b script -f $WORK/etc/my_serial" | ||
|
||
cat >$EXPECTED <<EOF | ||
12345678 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 Nerves Project Developers | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Script that prints something but returns error should fail | ||
# | ||
|
||
cat >$WORK/etc/my_serial <<EOF | ||
#!/bin/sh | ||
printf "12345678" | ||
exit 1 | ||
EOF | ||
chmod +x $WORK/etc/my_serial | ||
|
||
CMDLINE="-b script -f $WORK/etc/my_serial" | ||
|
||
cat >$EXPECTED <<EOF | ||
00000000000000000000000000000000 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 Nerves Project Developers | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Test that reading from stdin in the script doesn't hang | ||
# | ||
|
||
cat >$WORK/etc/my_serial <<EOF | ||
#!/bin/sh | ||
read bad_script | ||
cat >$WORK/testing | ||
printf "23456781" | ||
EOF | ||
chmod +x $WORK/etc/my_serial | ||
|
||
CMDLINE="-b script -f $WORK/etc/my_serial" | ||
|
||
cat >$EXPECTED <<EOF | ||
23456781 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 Nerves Project Developers | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Test script outputing too much. Result should max out at 31 characters. | ||
# | ||
|
||
cat >$WORK/etc/my_serial <<EOF | ||
#!/bin/sh | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
printf "0123456789" | ||
EOF | ||
chmod +x $WORK/etc/my_serial | ||
|
||
CMDLINE="-b script -f $WORK/etc/my_serial" | ||
|
||
cat >$EXPECTED <<EOF | ||
01234567890123456789012345678901 | ||
EOF |