aboutsummaryrefslogtreecommitdiff
path: root/se-generate.sh
blob: dfd3a95f956670dfa338e77134f26d69f9f8ca05 (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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash

################################################################################
# generate se-tb.yaml
# all manual/se/tb*.yaml files, except tb1-9
################################################################################
plan=plans/se-tb.yaml
cp plans/se-template.yaml ${plan}

sed -e "s/se-template/se-tb/g" -i ${plan}
sed -e "s/Scheider Electric template/Scheider Electric TB Test Plan/g" -i ${plan}
# TODO - describe what the TB test plan is"

testcases=($(ls -v manual/se/tb[1-9]?.yaml))
for testcase in "${testcases[@]}" ; do
	echo "    - path: ${testcase}" >> ${plan}
	echo "      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git" >> ${plan}
	echo "      branch: linaro" >> ${plan}
done

################################################################################
# generate se-tc.yaml
# all manual/se/tc*.yaml files
################################################################################
plan=plans/se-tc.yaml
cp plans/se-template.yaml ${plan}

sed -e "s/se-template/se-tc/g" -i ${plan}
sed -e "s/Scheider Electric template/Scheider Electric TC Test Plan/g" -i ${plan}
# TODO - describe what the TC test plan is"

testcases=($(ls -v manual/se/tc*.yaml))
for testcase in "${testcases[@]}" ; do
	echo "     - path: ${testcase}" >> ${plan}
	echo "       repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git" >> ${plan}
	echo "       branch: linaro" >> ${plan}
done

################################################################################
# generate se-others.yaml
# all manual/se/*.yaml files not included in se-tb and te-tc plans
################################################################################
plan=plans/se-others.yaml
cp plans/se-template.yaml ${plan}

sed -e "s/se-template/se-others/g" -i ${plan}
sed -e "s/Scheider Electric template/Scheider Electric Misc Manual Test Plan/g" -i ${plan}
# TODO - describe what this test plan is"

testcases=($(ls -v manual/se/*.yaml | grep -v t[bc][0-9]))
for testcase in "${testcases[@]}" ; do
	echo "    - path: ${testcase}" >> ${plan}
	echo "      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git" >> ${plan}
	echo "      branch: linaro" >> ${plan}
done

################################################################################
# generate se-all.yaml
# everything in se-auto.yaml, and all yamls in manual/se
################################################################################
plan=plans/se-all-tests.yaml
cp plans/se-auto.yaml ${plan}

sed -e "s/se-auto/se-all-tests/g" -i ${plan}
sed -e "s/Scheider Electric Automated Test Plan/Scheider Electric Test Plan describing all manual and automated tests performed when making a release/g" -i ${plan}
# TODO - describe what this test plan is"

echo "  manual:" >> ${plan}
testcases=($(ls -v manual/se/*.yaml | grep -v tb[0-9]-j | sort -V))

for testcase in "${testcases[@]}" ; do
	echo "    - path: ${testcase}" >> ${plan}
	echo "      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git" >> ${plan}
	echo "      branch: linaro" >> ${plan}
done


################################################################################
# Generate the HTML Test Plan
################################################################################
pushd plans
plan=se-all-tests.yaml
sed -e "s/Metadata/Schneider Electric Test Plan/g" -i templates/testplan_v2.html
python2 ./testplan2html.py -f ${plan} -i -s
popd