summaryrefslogtreecommitdiff
path: root/tests/00_regular_file_diff.sh
blob: 613d9245f5a57320b2cc785ebb0960620f144d70 (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
33
34
35
36
#!/bin/bash

TEST_ID="00"
TEST_NAME="Simple file diff"

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

. ./test_lib.sh

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

ORG_FILE=$ORIGIN/b.txt
TGT_FILE=$TARGET/b.txt

setup () {
	echo 1 >$ORIGIN/a.txt &&
	echo 2 >$TARGET/a.txt &&
	chgrp tty $ORIGIN/a.txt $TARGET/a.txt &&
	echo 1 > $ORG_FILE     && \
	echo 2 > $TGT_FILE     && \
	chown :cdrom $TGT_FILE    && \
	chmod 707 $TGT_FILE
}

check_results () {
	check_group      $ORIGIN/a.txt tty &&
	check_content    $ORG_FILE "2" && \
	check_perm       $ORG_FILE 707 && \
	check_group      $ORG_FILE cdrom && \
	check_same_mtime $ORG_FILE $TGT_FILE
}

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