Print this page
11838 secflag tests are racy

Split Close
Expand all
Collapse all
          --- old/usr/src/test/os-tests/tests/secflags/secflags_proc.sh
          +++ new/usr/src/test/os-tests/tests/secflags/secflags_proc.sh
↓ open down ↓ 5 lines elided ↑ open up ↑
   6    6  # You may only use this file in accordance with the terms of version
   7    7  # 1.0 of the CDDL.
   8    8  #
   9    9  # A full copy of the text of the CDDL should have accompanied this
  10   10  # source.  A copy of the CDDL is also available via the Internet at
  11   11  # http://www.illumos.org/license/CDDL.
  12   12  #
  13   13  
  14   14  #
  15   15  # Copyright 2015, Richard Lowe.
       16 +# Copyright 2019 Joyent, Inc.
  16   17  #
  17   18  
  18   19  /usr/bin/psecflags -s aslr -e sleep 100000 &
  19   20  pid=$!
  20   21  
  21   22  cleanup() {
  22   23      kill $pid
  23   24      rm /tmp/output.$$
  24   25      rm /tmp/expected.$$
  25   26  }
  26   27  
  27   28  trap cleanup EXIT
  28   29  
  29   30  cat > /tmp/expected.$$ <<EOF
  30   31  $pid:   sleep 100000
  31   32          E:      aslr
  32   33          I:      aslr
  33   34  EOF
  34   35  
       36 +# We need to wait for sleep to get exec()ed
       37 +sleep 1
       38 +
  35   39  /usr/bin/psecflags $pid | grep -v '[LU]:' > /tmp/output.$$
  36   40  
  37   41  if ! diff -u /tmp/expected.$$ /tmp/output.$$; then
  38   42      exit 1;
  39   43  fi
  40   44  
  41   45  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX