Debian Codegraph @

debian/tests/smoke

raw
1 #!/bin/sh
2
3 set -e
4
5 echo "Ensure apt integration is installed"
6 apt-config dump | grep -i Post-Invoke-Success | grep cnf-update-db
7
8 echo "Ensure apt update runs without errors"
9 apt-get update
10
11 echo "Ensure we have results from c-n-f"
12 /usr/lib/command-not-found --ignore-installed apt-ftparchive 2>&1 | grep apt-utils
13 /usr/lib/command-not-found --ignore-installed apt-ftparchive 2>&1 | grep -xF "apt install apt-utils"
14
15
16 echo "Add testuser"
17 adduser --gecos="no" --disabled-password testuser
18
19 echo "Ensure c-n-f works as user"
20 su -l testuser -c "/usr/lib/command-not-found --ignore-installed konsole" 2>&1 | grep konsole
21
22 echo "Ensure c-n-f database is world-readable" # cf. #986461
23 rm -f /var/lib/command-not-found/*
24 (umask 0077 && /usr/lib/cnf-update-db)
25 su -l testuser -c "/usr/lib/command-not-found --ignore-installed emacs" 2>&1 | grep emacs