#!/bin/bash
# meta: proxy=false
# meta: preconfig=./NFS-config
#
# Tests for the PyNFS 'create_session' suite.
#
# RNM1a : normal operation (symlink)
# RNM1d : normal operation (directory)
# RNM1r : normal operation (file)
# RNM2a : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (symlink)
# RNM2r : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (file)
# RNM4  : RENAME without (sfh) should return NFS4ERR_NOFILEHANDLE
# RNM5  : RENAME on non-existing object should return NFS4ERR_NOENT
# RNM6  : RENAME with zero length oldname should return NFS4ERR_INVAL
# RNM7  : RENAME with zero length newname should return NFS4ERR_INVAL
# RNM10 : RENAME from nonexistant . or .. should return _NOENT/_BADNAME
# RNM11 : RENAME into . or .. should return _BADNAME or NFS4_OK
# RNM12 : RENAME dir into existing nondir should return NFS4ERR_EXIST
# RNM14 : RENAME file into existing dir should return NFS4ERR_EXIST
# RNM15 : RENAME file into existing file should return NFS4_OK
# RNM16 : RENAME dir into existing, nonempty dir should return NFS4ERR_EXIST
# RNM17 : RENAME file into existing, nonempty dir should return NFS4ERR_EXIST
#
# Disabled due to currently failing:
#
#   RNM8  : RENAME with non-UTF8 oldname should return NFS4ERR_INVAL
#     "RENAME with non-UTF8 oldname RNM8_1309522783/\xc0\xc1 should return NFS4ERR_INVAL, instead got NFS4ERR_NOENT"
#   RNM9  : RENAME with non-UTF8 newname should return NFS4ERR_INVAL
#     "RENAME with non-UTF8 newname RNM9_1309522783/\xc0\xc1 should return NFS4ERR_INVAL, instead got NFS4_OK"
#   RNM13 : RENAME dir into existing, empty dir should retrun NFS4_OK
#     "RENAME dir1 into existing, empty dir2 should return NFS4_OK, instead got NFS4ERR_EXIST"
#   RNM18 : RENAME that does nothing
#     "OP_RENAME should return NFS4_OK, instead got NFS4ERR_EXIST"
#   RNM19 : RENAME that does nothing
#     "OP_RENAME should return NFS4_OK, instead got NFS4ERR_NOENT"
#   RNM20 : RENAME of file into its hard link should do nothing
#     "OP_LINK should return NFS4_OK, instead got NFS4ERR_STALE"
#
# Disabled due to not making sense in our implementation:
#
#   RNM1b : normal operation (block)
#   RNM1f : normal operation (fifo)
#   RNM1s : normal operation (socket)
#   RNM2b : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (block)
#   RNM2f : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (fifo)
#   RNM2s : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (socket)
#
# Needing further investigation:
# 
#   RNM1c : normal operation (char)
#   RNM2c : RENAME with non-dir (sfh) should return NFS4ERR_NOTDIR (char)
#   RNM3(a/b/c/f/r/s)
#

source ./Macros

#PYNFS_EXEC "$NFS41_EXEC $NFS_HOST:$NFS_HOME RNM1a RNM1d RNM2a RNM2r RNM4 RNM5 RNM6 RNM7 RNM10 \
#            RNM11 RNM16 --noinit"
exit $?
