feat(26.04): add e2fsprogs#883
Conversation
|
|
|
Blocked by #879 |
| summary: Integration tests for e2fsprogs | ||
|
|
||
| execute: | | ||
| rootfs="$(install-slices e2fsprogs_standard)" |
There was a problem hiding this comment.
I understand that standard contains everything, but we should test each of the slices separately to guarantee that they can work standalone.
For a better coverage I'd suggest to just run some smoke tests for the standard slice (just run -v and -h for the binaries) and move the functionality testing to a test for each individual slice.
Use variant and separated sh scripts for each variant (anticipating @lczyk's comment :p ) - For reference: example
There was a problem hiding this comment.
yep. seconded ☝️ :) makes for a muuuch cleaner code imo (bash linting + syntax highlight of the test files) + spread runs all the bits as separate tests, so if one breaks it does not take the whole test down
There was a problem hiding this comment.
Not a PR specific comment.
@lczyk @cjdcordeiro we have a bunch of tests for libraries like this one, but some other libraries are not tested - should we put a convention in place to always do a simple existence check for the files?
There was a problem hiding this comment.
i think lots of lower hanging fruit and i'm not convinced that simple existence test is really testing anything that installability tests are not testing already. honestly, i'd even say to remove this and libss2 tests
2217028 to
e9138e0
Compare
|
| summary: Integration tests for e2fsprogs | ||
|
|
||
| execute: | | ||
| rootfs="$(install-slices e2fsprogs_standard)" |
There was a problem hiding this comment.
yep. seconded ☝️ :) makes for a muuuch cleaner code imo (bash linting + syntax highlight of the test files) + spread runs all the bits as separate tests, so if one breaks it does not take the whole test down
There was a problem hiding this comment.
i think lots of lower hanging fruit and i'm not convinced that simple existence test is really testing anything that installability tests are not testing already. honestly, i'd even say to remove this and libss2 tests
| slices: | ||
| libs: | ||
| essential: | ||
| - libc6_libs |
There was a problem hiding this comment.
| - libc6_libs | |
| - libc6_libs | |
| - libcom-err2_libs |
libcom-err2_libs requires libcom_err.so.2 from libcom-err2. here's ldd output:
linux-vdso.so.1 (0x0000ffff8084c000)
libcom_err.so.2 => /usr/lib/aarch64-linux-gnu/libcom_err.so.2 (0x0000ffff80740000)
libc.so.6 => /usr/lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff80540000)
/lib/ld-linux-aarch64.so.1 (0x0000ffff80810000)
| /usr/sbin/fsck.ext2: | ||
| /usr/sbin/fsck.ext3: | ||
| /usr/sbin/fsck.ext4: |
There was a problem hiding this comment.
| /usr/sbin/fsck.ext2: | |
| /usr/sbin/fsck.ext3: | |
| /usr/sbin/fsck.ext4: | |
| /usr/sbin/fsck.ext2: # Symlink to e2fsck | |
| /usr/sbin/fsck.ext3: # Symlink to e2fsck | |
| /usr/sbin/fsck.ext4: # Symlink to e2fsck |
| /usr/sbin/mkfs.ext2: | ||
| /usr/sbin/mkfs.ext3: | ||
| /usr/sbin/mkfs.ext4: |
There was a problem hiding this comment.
| /usr/sbin/mkfs.ext2: | |
| /usr/sbin/mkfs.ext3: | |
| /usr/sbin/mkfs.ext4: | |
| /usr/sbin/mkfs.ext2: # Symlink to mke2fs | |
| /usr/sbin/mkfs.ext3: # Symlink to mke2fs | |
| /usr/sbin/mkfs.ext4: # Symlink to mke2fs |
| /usr/libexec/e2fsprogs/e2scrub_all_cron: | ||
| /usr/libexec/e2fsprogs/e2scrub_fail: | ||
| /usr/sbin/e2scrub: | ||
| /usr/sbin/e2scrub_all: |
There was a problem hiding this comment.
e2scrub and e2scrub_all are bash scripts. they should be in a slice called scripts, and have a dependency on bash_bins, base-files_bin (due to the shebang) and a pile of utils. then, if you want a slice named after a function, you could do something like this:
scrub:
essential:
- e2fsprogs_scripts
scripts:
...There was a problem hiding this comment.
also these should be tested. it looks like they both have help if you supply some non-existent flag. you can then assert the return code is 2. this is a bit annoying to do with the -e flag (which i nonetheless recommend strongly. here is a small working example
#!/usr/bin/env -S bash -ex
function my_program {
echo "doing something"
return 33
}
status_file="$(mktemp)"
trap "rm -f $status_file" EXIT
out="$(
set +e
my_program
echo "$?" >"$status_file"
)"
code="$(cat "$status_file")"
echo "code: $code"
echo "output: $out"There was a problem hiding this comment.
also, i've done the analysis of e2scrub and e2scrub_all and they depend on the following binaries:
e2scrub:
echo
awk
date
dumpe2fs
fstrim
grep
lsblk
lvs
realpath
sleep
e2scrub_all:
echo
dumpe2fs
grep
lsblk
lvs
readlink
sed
systemd-escape
i think you can skip the systemd part since the script accounts for it possibly not being there, but do add a comment saying that systemd-escape is needed for full systemd functionality
| - libext2fs2t64_libs | ||
| - libuuid1_libs | ||
| contents: | ||
| /usr/sbin/e2label: |
There was a problem hiding this comment.
| /usr/sbin/e2label: | |
| /usr/sbin/e2label: # Symlink to tune2fs |
| /usr/sbin/dumpe2fs: | ||
| /usr/sbin/e2freefrag: | ||
| /usr/sbin/e2image: | ||
| /usr/sbin/e2mmpstatus: |
There was a problem hiding this comment.
| /usr/sbin/e2mmpstatus: | |
| /usr/sbin/e2mmpstatus: # Symlink to dumpe2fs |
|
Proposed changes
The e2fsprogs suite is needed by Ubuntu Core 26. This needs logsave (#879) and systemd changes (#878)
Checklist