Skip to content

Commit ac30bc4

Browse files
authored
Merge branch 'ubuntu-24.04' into vim-tiny_noble
2 parents 901a80c + 1c0a3be commit ac30bc4

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

slices/bzip2.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package: bzip2
2+
3+
essential:
4+
- bzip2_copyright
5+
6+
slices:
7+
bins:
8+
essential:
9+
- libbz2-1.0_libs
10+
- libc6_libs
11+
contents:
12+
/usr/bin/bunzip2:
13+
/usr/bin/bzcat: { symlink: /usr/bin/bunzip2 }
14+
/usr/bin/bzip2: { symlink: /usr/bin/bunzip2 }
15+
/usr/bin/bzip2recover:
16+
17+
scripts:
18+
essential:
19+
- base-files_bin
20+
- base-files_tmp
21+
- bzip2_bins
22+
- coreutils_bins
23+
- diffutils_bins
24+
- grep_bins
25+
- grep_deprecated
26+
- less_bins
27+
- sed_bins
28+
- util-linux_file-manipulation
29+
contents:
30+
/usr/bin/bzcmp:
31+
/usr/bin/bzdiff:
32+
/usr/bin/bzegrep:
33+
/usr/bin/bzexe:
34+
/usr/bin/bzfgrep:
35+
/usr/bin/bzgrep:
36+
/usr/bin/bzless:
37+
/usr/bin/bzmore:
38+
39+
copyright:
40+
contents:
41+
/usr/share/doc/bzip2/copyright:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
summary: Integration tests for bzip2
2+
3+
execute: |
4+
5+
# testing for only bins slice
6+
rootfs_bins="$(install-slices bzip2_bins)"
7+
mkdir "${rootfs_bins}"/dev
8+
mount --rbind /dev "${rootfs_bins}"/dev
9+
10+
# generate a test file
11+
echo "this is a test file we use for compression with bzip2" > "${rootfs_bins}/input.txt"
12+
13+
# test compression commands
14+
chroot "${rootfs_bins}" /usr/bin/bzip2 -k input.txt
15+
cmp "${rootfs_bins}/input.txt" <(chroot "${rootfs_bins}" bzip2 -d -c input.txt.bz2)
16+
cmp "${rootfs_bins}/input.txt" <(chroot "${rootfs_bins}" bunzip2 -c input.txt.bz2)
17+
cmp "${rootfs_bins}/input.txt" <(chroot "${rootfs_bins}" bzcat input.txt.bz2)
18+
19+
# test bzip2recover
20+
chroot "${rootfs_bins}" bzip2recover input.txt.bz2
21+
22+
umount "${rootfs_bins}"/dev -l
23+
24+
25+
# testing for only scripts slice
26+
rootfs_script="$(install-slices bzip2_scripts)"
27+
mkdir "${rootfs_script}"/dev
28+
mount --rbind /dev "${rootfs_script}"/dev
29+
30+
# generate a test file
31+
echo "this is a test file we use for compression with bzip2" > "${rootfs_script}/input.txt"
32+
cp $SHELL "${rootfs_script}/shell"
33+
chroot "${rootfs_script}" /usr/bin/bzip2 -k input.txt
34+
35+
# test executable util
36+
chroot "${rootfs_script}" bzexe shell
37+
head -n1 "${rootfs_script}/shell" | grep "/bin/sh"
38+
39+
# test text utils
40+
chroot "${rootfs_script}" bzcmp input.txt.bz2 input.txt.bz2 | exit_code=$?
41+
chroot "${rootfs_script}" bzdiff input.txt.bz2 input.txt.bz2 | exit_code=$?
42+
chroot "${rootfs_script}" bzgrep "test" input.txt.bz2
43+
chroot "${rootfs_script}" bzfgrep "test" input.txt.bz2
44+
chroot "${rootfs_script}" bzegrep "test" input.txt.bz2
45+
46+
# test pagers
47+
chroot "${rootfs_script}" bzless "test" input.txt.bz2 > /dev/null
48+
chroot "${rootfs_script}" bzmore "test" input.txt.bz2 > /dev/null
49+
50+
umount "${rootfs_script}"/dev -l

0 commit comments

Comments
 (0)