-
Notifications
You must be signed in to change notification settings - Fork 31
/
0700-unifyfs-stage-full.t
executable file
·64 lines (47 loc) · 2.66 KB
/
0700-unifyfs-stage-full.t
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
#!/bin/bash
#
# Test unifyfs-stage executable for basic functionality
#
test_description="Test basic functionality of unifyfs-stage executable"
. $(dirname $0)/sharness.sh
test_expect_success "unifyfs-stage exists" '
test_path_is_file ${SHARNESS_BUILD_DIRECTORY}/util/unifyfs-stage/src/unifyfs-stage
'
test_expect_success "testing temp dir exists" '
test_path_is_dir ${UNIFYFS_TEST_TMPDIR}
'
mkdir -p ${UNIFYFS_TEST_TMPDIR}/config_0700
mkdir -p ${UNIFYFS_TEST_TMPDIR}/stage_source
mkdir -p ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700
test_expect_success "stage testing dirs exist" '
test_path_is_dir ${UNIFYFS_TEST_TMPDIR}/config_0700
test_path_is_dir ${UNIFYFS_TEST_TMPDIR}/stage_source
test_path_is_dir ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700
'
dd if=/dev/urandom bs=4M count=1 of=${UNIFYFS_TEST_TMPDIR}/stage_source/source_0700.file
test_expect_success "source.file exists" '
test_path_is_file ${UNIFYFS_TEST_TMPDIR}/stage_source/source_0700.file
'
rm -f ${UNIFYFS_TEST_TMPDIR}/config_0700/*
rm -f ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700/*
test_expect_success "config_0700 directory is empty" '
test_dir_is_empty ${UNIFYFS_TEST_TMPDIR}/config_0700
'
echo "\"${UNIFYFS_TEST_TMPDIR}/stage_source/source_0700.file\" \"${UNIFYFS_TEST_MOUNT}/intermediate.file\"" > ${UNIFYFS_TEST_TMPDIR}/config_0700/test_IN.manifest
echo "\"${UNIFYFS_TEST_MOUNT}/intermediate.file\" \"${UNIFYFS_TEST_TMPDIR}/stage_destination_0700/destination_0700.file\"" > ${UNIFYFS_TEST_TMPDIR}/config_0700/test_OUT.manifest
test_expect_success "config_0700 directory now has manifest files" '
test_path_is_file ${UNIFYFS_TEST_TMPDIR}/config_0700/test_IN.manifest
test_path_is_file ${UNIFYFS_TEST_TMPDIR}/config_0700/test_OUT.manifest
'
test_expect_success "target directory is empty" '
test_dir_is_empty ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700
'
$JOB_RUN_COMMAND ${SHARNESS_BUILD_DIRECTORY}/util/unifyfs-stage/src/unifyfs-stage -m ${UNIFYFS_TEST_MOUNT} ${UNIFYFS_TEST_TMPDIR}/config_0700/test_IN.manifest > ${UNIFYFS_TEST_TMPDIR}/config_0700/stage_IN_output.OUT 2>&1
$JOB_RUN_COMMAND ${SHARNESS_BUILD_DIRECTORY}/util/unifyfs-stage/src/unifyfs-stage -m ${UNIFYFS_TEST_MOUNT} ${UNIFYFS_TEST_TMPDIR}/config_0700/test_OUT.manifest > ${UNIFYFS_TEST_TMPDIR}/config_0700/stage_OUT_output.OUT 2>&1
test_expect_success "input file has been staged to output" '
test_path_is_file ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700/destination_0700.file
'
test_expect_success "final output is identical to initial input" '
test_might_fail test_cmp ${UNIFYFS_TEST_TMPDIR}/stage_source/source_0700.file ${UNIFYFS_TEST_TMPDIR}/stage_destination_0700/destination_0700.file
'
test_done