~andyc/oil

320dd2c665fe90f279a00636cacdba00b21fb4fd — Andy Chu a month ago 143e4fb release/0.9.2
[test/spec] Fix case in spec/oil-options

- Try to fix redirect issue on Travis as well.  Our Github project
  somehow still cares about Travis failure.
2 files changed, 5 insertions(+), 6 deletions(-)

M spec/oil-options.test.sh
M spec/redirect.test.sh
M spec/oil-options.test.sh => spec/oil-options.test.sh +0 -1
@@ 197,7 197,6 @@ shopt -s parse_at
shopt -s parse_brace
shopt -s parse_paren
shopt -s parse_raw_string
shopt -s parse_triple_dot
shopt -s parse_triple_quote
shopt -s pipefail
shopt -s process_sub_fail

M spec/redirect.test.sh => spec/redirect.test.sh +5 -5
@@ 291,6 291,8 @@ echo DONE

#### Redirect to file descriptor that's not open
# Notes:
# - 7/2021: descriptor 7 seems to work on all CI systems.  The process state
#   isn't clean, but we could probably close it in OSH?
# - dash doesn't allow file descriptors greater than 9.  (This is a good
#   thing, because the bash chapter in AOSA book mentions that juggling user
#   vs.  system file descriptors is a huge pain.)


@@ 302,11 304,6 @@ echo DONE
#   - You actually have to set the file descriptor to something.  What do
#   configure and debootstrap too?

# 3/2020 note: file descriptor 9 failed on Travis, so I changed it to 8.  The
# process state isn't necessarly clean.  TODO: Close the descriptor when OSH
# supports it?
# 7/2021: try descriptor 7

opened=$(ls /proc/$$/fd)
if echo "$opened" | egrep '^7$'; then
  echo "FD 7 shouldn't be open"


@@ 397,6 394,9 @@ cat "$TMP/f.txt"

# 7/2021: descriptor 8 is open on Github Actions, so use descriptor 6 instead

# Fix for CI systems where process state isn't clean: Close descriptors 6 and 7.
exec 6>&- 7>&-

opened=$(ls /proc/$$/fd)
if echo "$opened" | egrep '^7$'; then
  echo "FD 7 shouldn't be open"