FILES
}
+function afterfiles_exec {
+cat <<FILES
+d $TOP_LOWER_DIR
+d $LOWER_DIR0
+f $LOWER_DIR0/a
+f $LOWER_DIR0/a.out
+f $LOWER_DIR0/foo.c
+d $LOWER_DIR1
+f $LOWER_DIR1/b
+d $LOWER_DIR2
+d $LOWER_DIR3
+FILES
+}
+
# read-only mmap test
function test_ro {
init_odf
discard_odf
}
+# read-write compile+execute test
+function test_exec {
+ ( files ) | create_hierarchy
+ dd if=/dev/zero of=$LOWER_DIR0/a bs=4096 count=4 2>/dev/null
+ dd if=/dev/zero of=$LOWER_DIR1/b bs=4096 count=4 2>/dev/null
+ mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro
+ echo 'int main() { exit(0); }' > $MOUNTPOINT/foo.c
+ cc -o $MOUNTPOINT/a.out $MOUNTPOINT/foo.c 2> /dev/null || exit $?
+ $MOUNTPOINT/a.out || exit $?
+ echo -n "[exec] "
+ unmount_union
+ ( afterfiles_exec ) | check_hierarchy $TOP_LOWER_DIR
+}
+
test_ro
# skip on file systems which do not allow writeable mappings
case "$FS0" in
jffs2 | ramfs ) ;;
- * ) test_rw ;;
+ * )
+ test_rw
+ test_exec
+ ;;
esac
complete_test