File: smoke

package info (click to toggle)
command-not-found 23.04.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,064 kB
  • sloc: python: 1,008; sh: 29; makefile: 9
file content (25 lines) | stat: -rwxr-xr-x 846 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

echo "Ensure apt integration is installed"
apt-config dump | grep -i Post-Invoke-Success | grep cnf-update-db

echo "Ensure apt update runs without errors"
apt-get update

echo "Ensure we have results from c-n-f"
/usr/lib/command-not-found --ignore-installed apt-ftparchive 2>&1 | grep apt-utils
/usr/lib/command-not-found --ignore-installed apt-ftparchive 2>&1 | grep -xF "apt install apt-utils"


echo "Add testuser"
adduser --gecos="no" --disabled-password testuser

echo "Ensure c-n-f works as user"
su -l testuser -c "/usr/lib/command-not-found --ignore-installed konsole" 2>&1 | grep konsole

echo "Ensure c-n-f database is world-readable"    # cf. #986461
rm -f /var/lib/command-not-found/*
(umask 0077 && /usr/lib/cnf-update-db)
su -l testuser -c "/usr/lib/command-not-found --ignore-installed emacs" 2>&1 | grep emacs