File: test_extract_section

package info (click to toggle)
openstack-pkg-tools 117
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 904 kB
  • sloc: sh: 3,994; makefile: 31
file content (29 lines) | stat: -rwxr-xr-x 940 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -e

. ../../../pkgos_func
. ../../../tests/osstt

cp example.ini example-fortest.ini
pkgos_extract_section example-fortest.ini example-fortest-db.ini api-database
osstt_assertFilesAreSame example-after-removed-section.ini example-fortest.ini
if [ "${RET}" != "yes" ] ; then
	echo "pkgos_extract_section didn't extract a section correctly"
	echo "Diff of source file:"
	diff -u example-after-removed-section.ini example-fortest.ini
	rm -f example-fortest.ini example-fortest-db.ini
	exit 1
fi

osstt_assertFilesAreSame example-extracted-section.ini example-fortest-db.ini
if [ "${RET}" = "yes" ] ; then
	rm -f example-fortest.ini example-fortest-db.ini
        exit 0
else
        echo "pkgos_extract_section didn't extract a section correctly"
        echo "Diff of extracted section file:"
        diff -u example-extracted-section.ini example-fortest-db.ini
	rm example-fortest.ini example-fortest-db.ini
        exit 1
fi