1#!/bin/sh
2# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5# setup: mkdir -p "%T/c/bin" "%T/c/lib64" "%T/c/lib" "%T/c/usr/lib" "%T/c/usr/local" "%T/c/tmp-rw" "%T/c/tmp-ro" "%T/tmp"
6# args: -b /bin,/bin -b /lib,/lib -b /usr/lib,/usr/lib -b /usr/local,/usr/local -b %T/tmp,/tmp-rw,1 -b %T/tmp,/tmp-ro -P "%T/c" -v
7# args64: -b /lib64,/lib64
8
9# Can't get at common.sh from here... oops :)
10die () {
11  echo "$@"
12  exit 1
13}
14
15wd=$(pwd)
16[ "$wd" != "/" ] && die "not in /"
17[ ! -d /lib ] && die "no /lib"
18[ ! -d /tmp-rw ] && die "no /tmp-rw"
19[ ! -d /tmp-ro ] && die "no /tmp-ro"
20echo 'x' > /tmp-rw/test-rw || die "non-writeable /tmp-rw"
21echo 'x' > /tmp-ro/test-ro && die "writeable /tmp-ro"
22exit 0
23