-
Notifications
You must be signed in to change notification settings - Fork 61
/
build-rpms.bats
54 lines (49 loc) · 2.08 KB
/
build-rpms.bats
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
load ../common
@test 'build/install/uninstall RPMs' {
scope standard
prerequisites_ok centos7
[[ -d ../.git ]] || skip "not in Git working directory"
command -v sphinx-build > /dev/null 2>&1 || skip 'Sphinx is not installed'
img=${ch_imgdir}/centos7
# Build and install RPMs into CentOS 7 image.
(cd .. && packaging/fedora/build --install --image="$img" \
--rpmbuild="$BATS_TMPDIR/rpmbuild" HEAD)
# Do installed RPMs look sane?
run ch-run "$img" -- rpm -qa "charliecloud*"
echo "$output"
[[ $status -eq 0 ]]
[[ $output = *'charliecloud-'* ]]
[[ $output = *'charliecloud-debuginfo-'* ]]
[[ $output = *'charliecloud-test-'* ]]
run ch-run "$img" -- rpm -ql "charliecloud"
echo "$output"
[[ $status -eq 0 ]]
[[ $output = *'/usr/bin/ch-run'* ]]
[[ $output = *'/usr/libexec/charliecloud/base.sh'* ]]
[[ $output = *'/usr/share/man/man1/charliecloud.1.gz'* ]]
run ch-run "$img" -- rpm -ql "charliecloud-debuginfo"
echo "$output"
[[ $status -eq 0 ]]
[[ $output = *'/usr/lib/debug/usr/bin/ch-run.debug'* ]]
[[ $output = *'/usr/lib/debug/usr/libexec/charliecloud/test/sotest/lib/libsotest.so.1.0.debug'* ]]
run ch-run "$img" -- rpm -ql "charliecloud-test"
echo "$output"
[[ $status -eq 0 ]]
[[ $output = *'/usr/libexec/charliecloud/examples/mpi/lammps/Dockerfile'* ]]
[[ $output = *'/usr/libexec/charliecloud/test/Build.centos7xz'* ]]
[[ $output = *'/usr/libexec/charliecloud/test/sotest/lib/libsotest.so.1.0'* ]]
# Uninstall to avoid interfering with the rest of the test suite.
run ch-run -w "$img" -- rpm -v --erase charliecloud-test \
charliecloud-debuginfo \
charliecloud
echo "$output"
[[ $status -eq 0 ]]
[[ $output = *'charliecloud-'* ]]
[[ $output = *'charliecloud-debuginfo-'* ]]
[[ $output = *'charliecloud-test-'* ]]
# All gone?
run ch-run "$img" -- rpm -qa "charliecloud*"
echo "$output"
[[ $status -eq 0 ]]
[[ $output = '' ]]
}