assertTrue "Sources list meta info should be present""[ -e squashfs/var/lib/apt/lists/deb\.debian\.org_debian_dists_unstable_main_binary-amd64_Packages ]"
assertTrue "The kernel from the snapshot is used""grep -q '^linux-image-6\.9\.7-amd64' chroot.packages.install"
assertTrue "The kernel from the snapshot will be booted""[ -e squashfs/boot/vmlinuz-6.9.7-amd64 ]"
assertTrue "Main package is installed (install)""grep -q '^hwdata' chroot.packages.install"
assertTrue "Dependency package is installed (install)""grep -q '^pci.ids' chroot.packages.install"
assertTrue "Main package is installed (live)""grep -q '^hwdata' chroot.packages.live"
assertTrue "Dependency package is installed (live)""grep -q '^pci.ids' chroot.packages.live"
mountSquashfs
assertFalse "Main package stays after installation""grep -q '^hwdata' iso/live/filesystem.packages-remove"
assertFalse "Dependency package stays after installation""grep -q '^pci\.ids' iso/live/filesystem.packages-remove"
assertTrue "Main package should be in the pool""[ -e iso/pool/main/h/hwdata/hwdata_*_all.deb ]"
assertTrue "Dependency package should be in the pool""[ -e iso/pool/main/p/pci.ids/pci.ids_*_all.deb ]"
assertTrue "Package pool is listed in /etc/apt/sources.list""grep -q 'file:/run/live/medium' squashfs/etc/apt/sources.list"
assertTrue "Sources list meta info should be present: Release""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_Release ]"
assertTrue "Sources list meta info should be present: Packages""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_main_binary-amd64_Packages ]"
unmountSquashfs
}
function test_preexisting_package_inclusion_binary(){
assertFalse "Main package is not installed (install)""grep -q '^hwdata' chroot.packages.install"
assertFalse "Dependency package is not installed (install)""grep -q '^pci.ids' chroot.packages.install"
assertFalse "Main package is not installed (live)""grep -q '^hwdata' chroot.packages.live"
assertFalse "Dependency package is not installed (live)""grep -q '^pci.ids' chroot.packages.live"
mountSquashfs
assertFalse "Main package stays after installation""grep -q '^hwdata' iso/live/filesystem.packages-remove"
assertFalse "Dependency package stays after installation""grep -q '^pci\.ids' iso/live/filesystem.packages-remove"
assertTrue "Main package should be in the pool""[ -e iso/pool/main/h/hwdata/hwdata_*_all.deb ]"
assertTrue "Dependency package should be in the pool""[ -e iso/pool/main/p/pci.ids/pci.ids_*_all.deb ]"
assertTrue "Package pool is listed in /etc/apt/sources.list""grep -q 'file:/run/live/medium' squashfs/etc/apt/sources.list"
assertTrue "Sources list meta info should be present: Release""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_Release ]"
assertTrue "Sources list meta info should be present: Packages""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_main_binary-amd64_Packages ]"
# config/packages.binary is only used when an installer is requested
lb config --debian-installer live
build_image
assertFalse "Packaged file for main package should not be present""grep -q '^-rw-r--r--.* testpackage-config-packages-binary-main-file$' chroot.files"
assertFalse "Packaged file for dependency package should not be present""grep -q '^-rw-r--r--.* testpackage-config-packages-binary-dependency-file$' chroot.files"
assertFalse "Main package is not installed (install)""grep -q '^live-testpackage-config-packages-binary-main' chroot.packages.install"
assertFalse "Dependency package is not installed (install)""grep -q '^live-testpackage-config-packages-binary-dependency' chroot.packages.install"
assertFalse "Main package is not installed (live)""grep -q '^live-testpackage-config-packages-binary-main' chroot.packages.live"
assertFalse "Dependency package is not installed (live)""grep -q '^live-testpackage-config-packages-binary-dependency' chroot.packages.live"
mountSquashfs
assertTrue "Main package should be in the pool""[ -e iso/pool/main/l/live-testpackage-config-packages-binary-main/live-testpackage-config-packages-binary-main_1.0_all.deb ]"
assertTrue "Dependency package should be in the pool""[ -e iso/pool/main/l/live-testpackage-config-packages-binary-dependency/live-testpackage-config-packages-binary-dependency_1.0_all.deb ]"
assertTrue "Package pool is listed in /etc/apt/sources.list""grep -q 'file:/run/live/medium' squashfs/etc/apt/sources.list"
assertTrue "Sources list meta info should be present: Release""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_Release ]"
assertTrue "Sources list meta info should be present: Packages""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_main_binary-amd64_Packages ]"
assertTrue "Packaged file for main package should be present""grep -q '^-rw-r--r--.* testpackage-config-packages-chroot-main-file$' chroot.files"
assertTrue "Packaged file for dependency package should be present""grep -q '^-rw-r--r--.* testpackage-config-packages-chroot-dependency-file$' chroot.files"
assertTrue "Main package is installed (install)""grep -q '^live-testpackage-config-packages-chroot-main' chroot.packages.install"
assertTrue "Dependency package is installed (install)""grep -q '^live-testpackage-config-packages-chroot-dependency' chroot.packages.install"
assertTrue "Main package is installed (live)""grep -q '^live-testpackage-config-packages-chroot-main' chroot.packages.live"
assertTrue "Dependency package is installed (live)""grep -q '^live-testpackage-config-packages-chroot-dependency' chroot.packages.live"
}
function test_remote_repository_unspecified_choot_or_binary(){
assertTrue "Package is installed (install)""grep -q '^casper' chroot.packages.install"
assertTrue "Package is installed (live)""grep -q '^casper' chroot.packages.live"
mountSquashfs
assertTrue "Sources list should be present""[ -e squashfs/etc/apt/sources.list.d/remote-config-archives-list.list ]"
assertTrue "Sources list meta info should be present""[ -e squashfs/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_binary-amd64_Packages ]"
assertTrue "Package is installed (install)""grep -q '^casper' chroot.packages.install"
assertTrue "Package is installed (live)""grep -q '^casper' chroot.packages.live"
mountSquashfs
assertTrue "Sources list should be present""[ -e squashfs/etc/apt/sources.list.d/remote-config-archives-list-chroot.list ]"
assertTrue "Sources list meta info should be present""[ -e squashfs/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_binary-amd64_Packages ]"
assertFalse "Package is not installed (install)""grep -q '^casper' chroot.packages.install"
assertFalse "Package is not installed (live)""grep -q '^casper' chroot.packages.live"
mountSquashfs
assertTrue "Sources list should be present""[ -e squashfs/etc/apt/sources.list.d/remote-config-archives-list-binary.list ]"
assertTrue "Sources list meta info should be present""[ -e squashfs/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_binary-amd64_Packages ]"
assertTrue "Package should be in the pool""find iso | grep 'iso/pool/main/c/casper/casper_.*_amd64\.deb'"
unmountSquashfs
}
function test_local_repository_unspecified_chroot_or_binary(){
assertNotNull "Not implemented yet: fails at bootstrap_archives at the moment"""
assertTrue "Packaged file for main package should be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-main-file$' chroot.files"
assertTrue "Packaged file for dependency package should be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-dependency-file$' chroot.files"
assertTrue "Main package is installed (install)""grep -q '^live-testpackage-config-archives-list-main' chroot.packages.install"
assertTrue "Dependency package is installed (install)""grep -q '^live-testpackage-config-archives-list-dependency' chroot.packages.install"
assertTrue "Main package is installed (live)""grep -q '^live-testpackage-config-archives-list-main' chroot.packages.live"
assertTrue "Dependency package is installed (live)""grep -q '^live-testpackage-config-archives-list-dependency' chroot.packages.live"
mountSquashfs
# The following files should not be present
# -> however, they currently are, because there is not detection whether the repo is reachable from within the running live environment
# -> this will result in an error message when 'apt-get update' is run in the live environment
assertFalse "Sources list should not be present""[ -e squashfs/etc/apt/sources.list.d/my_repro-config-archives-list.list ]"
assertFalse "Sources list meta info should not be present""find squashfs/var/lib/apt/lists | grep -q 'squashfs/var/lib/apt/lists/_*_testrepository-config-archives-list-'"
assertNotNull "Not implemented yet: fails at bootstrap_archives at the moment"""
assertTrue "Packaged file for main package should be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-chroot-main-file$' chroot.files"
assertTrue "Packaged file for dependency package should be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-chroot-dependency-file$' chroot.files"
assertTrue "Main package is installed (install)""grep -q '^live-testpackage-config-archives-list-chroot-main' chroot.packages.install"
assertTrue "Dependency package is installed (install)""grep -q '^live-testpackage-config-archives-list-chroot-dependency' chroot.packages.install"
assertTrue "Main package is installed (live)""grep -q '^live-testpackage-config-archives-list-chroot-main' chroot.packages.live"
assertTrue "Dependency package is installed (live)""grep -q '^live-testpackage-config-archives-list-chroot-dependency' chroot.packages.live"
mountSquashfs
# The following files should not be present
# -> however, they currently are, because there is not detection whether the repo is reachable from within the running live environment
# -> this will result in an error message when 'apt-get update' is run in the live environment
assertFalse "Sources list should not be present""[ -e squashfs/etc/apt/sources.list.d/my_repro-config-archives-list-chroot.list ]"
assertFalse "Sources list meta info should not be present""find squashfs/var/lib/apt/lists | grep -q 'squashfs/var/lib/apt/lists/_*_testrepository-config-archives-list-chroot-'"
assertNotNull "Not implemented yet: fails at lb chroot_prep remove all mode-archives-chroot with step lb chroot_archives chroot remove at the moment"""
assertFalse "Packaged file for main package should not be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-binary-main-file$' chroot.files"
assertFalse "Packaged file for dependency package should not be present""grep -q '^-rw-r--r--.* testpackage-config-archives-list-binary-dependency-file$' chroot.files"
assertFalse "Main package is not installed (install)""grep -q '^live-testpackage-config-archives-list-binary-main' chroot.packages.install"
assertFalse "Dependency package is not installed (install)""grep -q '^live-testpackage-config-archives-list-binary-dependency' chroot.packages.install"
assertFalse "Main package is not installed (live)""grep -q '^live-testpackage-config-archives-list-binary-main' chroot.packages.live"
assertFalse "Dependency package is not installed (live)""grep -q '^live-testpackage-config-archives-list-binary-dependency' chroot.packages.live"
mountSquashfs
assertTrue "Main package should be in the pool""[ -e iso/pool/main/l/live-testpackage-config-archives-list-binary-main/live-testpackage-config-archives-list-binary-main_1.0_all.deb ]"
assertTrue "Dependency package should be in the pool""[ -e iso/pool/main/l/live-testpackage-config-archives-list-binary-dependency/live-testpackage-config-archives-list-binary-dependency_1.0_all.deb ]"
assertTrue "Package pool is listed in /etc/apt/sources.list""grep -q 'file:/run/live/medium' squashfs/etc/apt/sources.list"
assertTrue "Sources list meta info should be present: Release""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_Release ]"
assertTrue "Sources list meta info should be present: Packages""[ -e squashfs/var/lib/apt/lists/_run_live_medium_dists_unstable_main_binary-amd64_Packages ]"
assertNotNull "Not implemented yet: fails at bootstrap_archives at the moment"""
# Current issue: the /etc/apt/sources.list.d entry gets removed, but the index files and the packages are installed in the chroot
assertTrue "Packaged file for main package should be present""grep -q '^-rw-r--r--.* testpackage-config-opt-extra-repo-main-file$' chroot.files"
assertTrue "Packaged file for dependency package should be present""grep -q '^-rw-r--r--.* testpackage-config-opt-extra-repo-dependency-file$' chroot.files"
assertTrue "Main package is installed (install)""grep -q '^live-testpackage-config-opt-extra-repo-main' chroot.packages.install"
assertTrue "Dependency package is installed (install)""grep -q '^live-testpackage-config-opt-extra-repo-dependency' chroot.packages.install"
assertTrue "Main package is installed (live)""grep -q '^live-testpackage-config-opt-extra-repo-main' chroot.packages.live"
assertTrue "Dependency package is installed (live)""grep -q '^live-testpackage-config-opt-extra-repo-dependency' chroot.packages.live"
}
function test_derivatives(){
# Rebuild the configuration, as many mirror settings depend on eachother