summaryrefslogtreecommitdiff
path: root/tests/07_dir_add_remove.sh
blob: fe34a0ea1f0e196c539d14165873154c6649237a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

TEST_ID="07"
TEST_NAME="Directory add remove"

CREATE=`pwd`/$1
DEPLOY=`pwd`/$2
TEST_TOOLS=$3

. ./test_lib.sh

############# Test specific code ############

function setup {
	mkdir -p $ORIGIN/remove/1/2/3/4 && \
	mkdir -p $TARGET/add/4/3/2/1 && \
	chown -h :cdrom $TARGET/add
	chown -h :cdrom $TARGET/add/4/3/2/1
}

function check_results {
	test   -d $ORIGIN/add/4/3/2/1    && \
	test ! -d $ORIGIN/remove && \
	check_same_mtime  $ORIGIN/add $TARGET/add && \
	check_same_mode   $ORIGIN/add $TARGET/add && \
	check_same_uidgid $ORIGIN/add $TARGET/add && \
	check_same_mode   $ORIGIN/add $TARGET/add && \
	check_same_uidgid $ORIGIN/add/4/3/2/1 $TARGET/add/4/3/2/1
}

#############################################
main $@