1#! /bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. 4# Copyright (c) International Business Machines Corp., 2001 5# 6# PURPOSE: Tests NFS copy of various filesizes, file consistency 7# between copies and preservation of write/nowrite permissions. 8# 9# Ported by: Robbie Williamson (robbiew@us.ibm.com) 10 11TST_CNT=3 12TST_TESTFUNC="do_test" 13LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles" 14 15. nfs_lib.sh 16 17do_test1() 18{ 19 tst_res TINFO "do_test1 $TC" 20 ROD cp $LTP_DATAFILES/ascii.jmb . 21 tst_res TINFO "compare both ascii.jmbs" 22 ROD diff $LTP_DATAFILES/ascii.jmb ascii.jmb 23 24 tst_res TPASS "test1 passed" 25} 26 27do_test2() 28{ 29 tst_res TINFO "do_test2, copy data files" 30 local files="ascii.sm ascii.med ascii.lg" 31 32 for f in $files; do 33 tst_res TINFO "copy '$f' file" 34 ROD cp $LTP_DATAFILES/$f . 35 ROD cp $f ${f}cp 36 ROD diff $LTP_DATAFILES/$f ${f}cp 37 done 38 39 tst_res TPASS "test2 passed" 40} 41 42do_test3() 43{ 44 tst_res TINFO "do_test3, test permissions" 45 ROD chmod a-wx ascii.sm 46 ROD ls -l ascii.sm | grep -q "r--" 47 ROD chmod a+w ascii.sm 48 tst_res TPASS "test3 passed" 49} 50 51tst_run 52