• 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_TESTFUNC=cpio_test
27TST_NEEDS_TMPDIR=1
28TST_NEEDS_CMDS="cpio"
29. tst_test.sh
30
31cpio_test()
32{
33	ROD mkdir "dir"
34	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
35		ROD echo "Test" > "dir/$i"
36	done
37
38	ROD find dir -type f > filelist
39	EXPECT_PASS cpio -o \> cpio.out \< filelist
40	ROD mv "dir" "dir_orig"
41	ROD mkdir "dir"
42	EXPECT_PASS cpio -i \< cpio.out
43
44	if diff -r "dir" "dir_orig"; then
45		tst_res TPASS "Directories dir and dir_orig are equal"
46	else
47		tst_res TFAIL "Directories dir and dir_orig differ"
48		ls -R dir_orig
49		echo
50		ls -R dir
51	fi
52}
53
54tst_run
55