Testing Debian Packages

The following describes content-test for each Debian package (either on the host or on the target system).

  1. Select a directory where the packages are verified (here referenced as $test_base_dir).

  2. Create a "fake"-admin directory to avoid messing up test installations with regular installations:

    mkdir -p $test_base_dir/fakeroot/var/lib/dpkg/updates
    mkdir -p $test_base_dir/fakeroot/var/lib/dpkg/info
    touch $test_base_dir/fakeroot/var/lib/dpkg/status
    Note:

    nvidia-driveos-core_<DRIVEOS_RELEASE>.deb and nvidia-driveos_<DRIVEOS_RELEASE>.deb do not contain file only dependencies and do not have corresponding copytarget-*.yaml files.

  3. For each Debian package:
    • Create a "fake"-root directory named package-name_root.

      mkdir p $test_base_dir/package-name_root
    • Install the Debian package into this $test_base_dir/package-name_root directory.

      On the host:

      sudo dpkg --force-architecture --
      admindir=$test_base_dir/fakeoot /var/lib/dpkg --
      instdir=$test_base_dir/package-name_root/ --force-depends --
      install absolute_path_of_debian_package

      On target system:

      sudo dpkg --admindir=$test_base_dir/fakeroot 
      /var/lib/dpkg --instdir=$test_base_dir/package-name_root/ --
      force-depends --install absolute_path_of_debian_package