tazpkg view tests/test06 @ rev 955

modules/search: allow search file with dash at start: tazpkg -sf "-spi"
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 22 00:02:54 2017 +0200 (2017-12-22)
parents
children
line source
1 #!/bin/sh
2 #
3 . /lib/libtaz.sh
4 check_root
5 export root='/tmp/test'
7 title 'Test #06'
8 colorize 033 "$(longline "Test virtual package rules")"
9 newline
11 ########
12 boldify '1/4. Install "ssh"'
13 tazpkg --nodeps -gi pam
14 tazpkg --nodeps -gi ssh
15 tazpkg -l
16 ########
18 installedssh="$(ls $root/var/lib/tazpkg/installed | fgrep ssh)"
20 if [ "$installedssh" != 'openssh-pam' ]; then
21 colorize 31 "ERROR. Expected package 'openssh-pam' installed. Given: '$installedssh' Exit test"
22 exit 1
23 fi
25 ########
26 boldify '2/4. Install "openssh"'
27 tazpkg --nodeps -gi openssh
28 tazpkg -l
29 ########
31 if [ -d "$root/var/lib/tazpkg/installed/openssh" ]; then
32 colorize 31 "ERROR. Expected package 'openssh' NOT installed. Exit test"
33 exit 1
34 fi
36 ########
37 boldify '3/4. Remove "pam", "openssh-pam"; install "ssh"'
38 yes y | tazpkg -r pam
39 yes y | tazpkg -r openssh-pam
40 tazpkg --nodeps -gi ssh
41 tazpkg -l
42 ########
44 if [ ! -d "$root/var/lib/tazpkg/installed/openssh" ]; then
45 colorize 31 "ERROR. Expected package 'openssh' installed. Exit test"
46 exit 1
47 fi
49 ########
50 boldify '4/4. Remove "ssh"'
51 yes y | tazpkg -r ssh
52 tazpkg -l
53 ########
55 if [ -d "$root/var/lib/tazpkg/installed/openssh" ]; then
56 colorize 31 "ERROR. Expected package 'openssh' NOT installed. Exit test"
57 exit 1
58 fi
61 footer "$(colorize 32 'Test #06 passed')"
62 exit 0