Skip to content

Commit

Permalink
containers: Run unit-tests stdio checks with Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Jul 4, 2018
1 parent e613936 commit d75f0e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions containers/unit-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export LANG=C.UTF-8

# HACK: Something invoked by our build system is setting stdio to non-blocking.
# Validate that this isn't the surrounding context. See more below.
python -c "import fcntl, os; assert fcntl.fcntl(0, fcntl.F_GETFL) & os.O_NONBLOCK == 0; assert fcntl.fcntl(1, fcntl.F_GETFL) & os.O_NONBLOCK == 0; assert fcntl.fcntl(2, fcntl.F_GETFL) & os.O_NONBLOCK == 0"
python3 -c "import fcntl, os; assert fcntl.fcntl(0, fcntl.F_GETFL) & os.O_NONBLOCK == 0; assert fcntl.fcntl(1, fcntl.F_GETFL) & os.O_NONBLOCK == 0; assert fcntl.fcntl(2, fcntl.F_GETFL) & os.O_NONBLOCK == 0"

# copy host's source tree to avoid changing that, and make sure we have a clean tree
if [ ! -e /source/.git ]; then
Expand Down Expand Up @@ -39,7 +39,7 @@ make V=1 all

# HACK: Before running the tests we need to make sure stdio is in blocking mode. We have
# not yet been able to figure out what is putting it non-blocknig.
python -c "import fcntl, os; map(lambda fd: fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) &~ os.O_NONBLOCK), [0, 1, 2])"
python3 -c "import fcntl, os; map(lambda fd: fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) &~ os.O_NONBLOCK), [0, 1, 2])"

# only run distcheck on main arch
if [ "$ARCH" = amd64 ]; then
Expand Down

0 comments on commit d75f0e9

Please sign in to comment.