• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2################################################################################
3##                                                                            ##
4## Copyright (c) International Business Machines  Corp., 2001                 ##
5##  Author: Manoj Iyer, manjo@mail.utexas.edu                                 ##
6## Copyright (c) Cyril Hrubis <chrubis@suse.cz>                               ##
7##                                                                            ##
8## This program is free software;  you can redistribute it and#or modify      ##
9## it under the terms of the GNU General Public License as published by       ##
10## the Free Software Foundation; either version 2 of the License, or          ##
11## (at your option) any later version.                                        ##
12##                                                                            ##
13## This program is distributed in the hope that it will be useful, but        ##
14## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
15## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
16## for more details.                                                          ##
17##                                                                            ##
18## You should have received a copy of the GNU General Public License          ##
19## along with this program;  if not, write to the Free Software Foundation,   ##
20## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
21##                                                                            ##
22################################################################################
23#
24# Test basic functionality of cpio command
25#
26TST_ID="cpio01"
27TST_TESTFUNC=cpio_test
28TST_NEEDS_TMPDIR=1
29TST_NEEDS_CMDS="cpio"
30. tst_test.sh
31
32cpio_test()
33{
34	ROD mkdir "dir"
35	for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
36		ROD echo "Test" > "dir/$i"
37	done
38
39	ROD find dir -type f > filelist
40	EXPECT_PASS cpio -o \> cpio.out \< filelist
41	ROD mv "dir" "dir_orig"
42	ROD mkdir "dir"
43	EXPECT_PASS cpio -i \< cpio.out
44
45	if diff -r "dir" "dir_orig"; then
46		tst_res TPASS "Directories dir and dir_orig are equal"
47	else
48		tst_res TFAIL "Directories dir and dir_orig differ"
49		ls -R dir_orig
50		echo
51		ls -R dir
52	fi
53}
54
55tst_run
56