File: makeflow_dirs_test_common.sh

package info (click to toggle)
cctools 1%3A7.14.5-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,956 kB
  • sloc: ansic: 114,614; python: 29,532; cpp: 20,313; sh: 13,675; perl: 4,056; xml: 3,688; makefile: 1,436
file content (69 lines) | stat: -rw-r--r-- 1,047 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /bin/sh

STATUS_FILE=makeflow.status
PORT_FILE=makeflow.port

prepare()
{
	rm -f $STATUS_FILE
	rm -f $PORT_FILE

	rm -rf input
	rm -rf mydir

	mkdir -p input
	echo world > input/hello

	exit 0
}

run()
{
	# send makeflow to the background, saving its exit status.
	(../src/makeflow -d all -T vine -Z $PORT_FILE  $MAKE_FILE; echo $? > $STATUS_FILE) &

	# wait at most 10 seconds for makeflow to find a port.
        wait_for_file_creation $PORT_FILE 10

	run_taskvine_worker $PORT_FILE worker.log

	# wait for makeflow to exit.
	wait_for_file_creation $STATUS_FILE 10

	# retrieve makeflow exit status
	status=`cat $STATUS_FILE`
	if [ $status -ne 0 ]
	then
		exit 1
	fi
	# verify that makeflow created the required files from
	# $MAKE_FILE
	for file in $PRODUCTS
	do
		if [ ! -f $file ]
		then
			exit 1
		fi
	done

	exit 0
}

clean()
{
	../src/makeflow -c $MAKE_FILE
	rm -f $STATUS_FILE
	rm -f $PORT_FILE
	rm -f worker.log

	rm -rf input
	rm -rf mydir

	[ $DELETE_MAKE_FILE ] && rm -f $MAKE_FILE

	exit 0
}



# vim: set noexpandtab tabstop=4: