Debian Codegraph @

tests/pkgos_func/extract_section/test_extract_section

raw
1 #!/bin/sh
2
3 set -e
4
5 . ../../../pkgos_func
6 . ../../../tests/osstt
7
8 cp example.ini example-fortest.ini
9 pkgos_extract_section example-fortest.ini example-fortest-db.ini api-database
10 osstt_assertFilesAreSame example-after-removed-section.ini example-fortest.ini
11 if [ "${RET}" != "yes" ] ; then
12 echo "pkgos_extract_section didn't extract a section correctly"
13 echo "Diff of source file:"
14 diff -u example-after-removed-section.ini example-fortest.ini
15 rm -f example-fortest.ini example-fortest-db.ini
16 exit 1
17 fi
18
19 osstt_assertFilesAreSame example-extracted-section.ini example-fortest-db.ini
20 if [ "${RET}" = "yes" ] ; then
21 rm -f example-fortest.ini example-fortest-db.ini
22 exit 0
23 else
24 echo "pkgos_extract_section didn't extract a section correctly"
25 echo "Diff of extracted section file:"
26 diff -u example-extracted-section.ini example-fortest-db.ini
27 rm example-fortest.ini example-fortest-db.ini
28 exit 1
29 fi