Skip to content

Commit ea47919

Browse files
authored
Merge branch 'ubuntu-24.04' into apache2_noble
2 parents 869ca6d + 1c0a3be commit ea47919

File tree

10 files changed

+239
-0
lines changed

10 files changed

+239
-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:

slices/less.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package: less
2+
3+
essential:
4+
- less_copyright
5+
6+
slices:
7+
bins:
8+
essential:
9+
- libc6_libs
10+
- libtinfo6_libs
11+
contents:
12+
/usr/bin/less:
13+
/usr/bin/lessecho:
14+
# Note that lesskey is deprecated since less version 582.
15+
/usr/bin/lesskey:
16+
17+
# pager conflicts with the one generated in util-linux_generated slice.
18+
# Manually link pager to less if required.
19+
# TODO: Add `prefer` to /usr/bin/pager when conflict resolution
20+
# is merged for chisel.
21+
# pager:
22+
# essential:
23+
# - less_bins
24+
# contents:
25+
# /usr/bin/pager: {symlink: /usr/bin/less}
26+
27+
copyright:
28+
contents:
29+
/usr/share/doc/less/copyright:

slices/netcat-openbsd.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package: netcat-openbsd
2+
3+
essential:
4+
- netcat-openbsd_copyright
5+
6+
slices:
7+
bins:
8+
essential:
9+
- libbsd0_libs
10+
- libc6_libs
11+
contents:
12+
/bin/nc.openbsd:
13+
14+
copyright:
15+
contents:
16+
/usr/share/doc/netcat-openbsd/copyright:

slices/unzip.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package: unzip
2+
3+
essential:
4+
- unzip_copyright
5+
6+
slices:
7+
bins:
8+
essential:
9+
- libbz2-1.0_libs
10+
- libc6_libs
11+
contents:
12+
/usr/bin/funzip:
13+
/usr/bin/unzip:
14+
/usr/bin/unzipsfx:
15+
# Should be a hard link, but Chisel does not yet support hard links
16+
# not yet support hard links.
17+
# TODO update this to a hard link once a
18+
# newer version of Chisel is released with
19+
# https://github.com/canonical/chisel/commit/9d9d2144cf47586d02ff7566b8764e70057987a4
20+
/usr/bin/zipinfo: {symlink: /usr/bin/unzip}
21+
22+
scripts:
23+
essential:
24+
- dash_bins
25+
- grep_deprecated
26+
- sed_bins
27+
- unzip_bins
28+
contents:
29+
/usr/bin/zipgrep:
30+
31+
copyright:
32+
contents:
33+
/usr/share/doc/unzip/copyright:

slices/zip.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package: zip
2+
3+
essential:
4+
- zip_copyright
5+
6+
slices:
7+
bins:
8+
essential:
9+
- libbz2-1.0_libs
10+
- libc6_libs
11+
contents:
12+
/usr/bin/zip:
13+
/usr/bin/zipcloak:
14+
/usr/bin/zipnote:
15+
/usr/bin/zipsplit:
16+
17+
copyright:
18+
contents:
19+
/usr/share/doc/zip/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
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
summary: Integration tests for less
2+
3+
execute: |
4+
rootfs="$(install-slices less_bins)"
5+
6+
chroot "${rootfs}/" less --version
7+
chroot "${rootfs}/" lesskey --version
8+
echo "Hello, World" > "${rootfs}/testfile.txt"
9+
test "$(chroot "${rootfs}/" less -F -X -R testfile.txt)" = "Hello, World"
10+
test "$(chroot "${rootfs}/" lessecho -m: a:b )" = "a\:b"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
summary: Integration tests for netcat-openbsd
2+
3+
execute: |
4+
rootfs="$(install-slices netcat-openbsd_bins)"
5+
6+
chroot "${rootfs}/" nc.openbsd -h
7+
chroot "${rootfs}/" nc.openbsd -l 1234 >testfile &
8+
echo "Hello World" | chroot "${rootfs}/" nc.openbsd -q 1 -w 1 127.0.0.1 1234
9+
test "$(cat testfile)" = "Hello World"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
summary: Integration tests for unzip
2+
3+
execute: |
4+
rootfs="$(install-slices base-files_bin unzip_bins unzip_scripts zip_bins)"
5+
6+
chroot "${rootfs}/" unzip -hh
7+
chroot "${rootfs}/" unzipsfx -hh
8+
9+
echo "Hello, World" > "${rootfs}/testfile.txt"
10+
chroot "${rootfs}" zip testfile.zip testfile.txt
11+
test "$(chroot "${rootfs}" unzip -p testfile.zip testfile.txt)" = "Hello, World"
12+
test "$(chroot "${rootfs}" zipinfo -1 testfile.zip)" = "testfile.txt"
13+
test "$( chroot "${rootfs}" funzip testfile.zip )" = "Hello, World"
14+
chroot "${rootfs}" zipgrep "Hello" testfile.zip
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
summary: Integration tests for zip
2+
3+
execute: |
4+
rootfs="$(install-slices unzip_bins zip_bins)"
5+
6+
chroot "${rootfs}/" zip -h2
7+
chroot "${rootfs}/" zipcloak -h
8+
chroot "${rootfs}/" zipnote -h
9+
chroot "${rootfs}/" zipsplit -h
10+
11+
echo "Hello, World" > "${rootfs}/testfile.txt"
12+
chroot "${rootfs}" zip testfile.zip testfile.txt
13+
chroot "${rootfs}" zipnote testfile.zip > foo.tmp
14+
echo -e "@ This is a test comment" >> foo.tmp
15+
chroot "${rootfs}" zipnote -w testfile.zip < foo.tmp
16+
test "$(chroot "${rootfs}" zipnote testfile.zip | tail -n1)" = "\@ This is a test comment"
17+
chroot "${rootfs}" zipsplit testfile.zip
18+
test "$(chroot "${rootfs}" unzip -p testfil1.zip testfile.txt)" = "Hello, World"

0 commit comments

Comments
 (0)