tazpkg diff tests/test01 @ rev 903
Tiny edits
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Mar 30 01:52:24 2016 +0300 (2016-03-30) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/test01 Wed Mar 30 01:52:24 2016 +0300 1.3 @@ -0,0 +1,68 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +. /lib/libtaz.sh 1.7 +check_root 1.8 +ROOT='/tmp/test' 1.9 + 1.10 +title 'Test #01' 1.11 +colorize 033 "$(longline "Check that tazpkg created all the base files and folders needed from \ 1.12 +scratch. Working in the folder $ROOT")" 1.13 +newline 1.14 + 1.15 +[ -d "$ROOT" ] && rm -rf "$ROOT" 1.16 + 1.17 +######## 1.18 +tazpkg --root=$ROOT 1.19 +######## 1.20 + 1.21 +dirnum=$(find "$ROOT" -type d | wc -l) 1.22 +if [ "$dirnum" -ne 11 ]; then 1.23 + colorize 35 "WARNING. Expected 11 folders; found $dirnum" 1.24 + WARNING=1 1.25 +fi 1.26 + 1.27 +filenum=$(find "$ROOT" -type f | wc -l) 1.28 +if [ "$filenum" -ne 21 ]; then 1.29 + colorize 35 "WARNING. Expected 21 files; found $filenum" 1.30 + WARNING=1 1.31 +fi 1.32 + 1.33 +for dir in /etc/slitaz /var/cache/tazpkg /var/lib/tazpkg/installed /var/log/slitaz; do 1.34 + if [ ! -d "$ROOT$dir" ]; then 1.35 + colorize 31 "ERROR. Folder $dir absent. Exit test" 1.36 + exit 1 1.37 + fi 1.38 +done 1.39 + 1.40 +for file in \ 1.41 + /etc/slitaz-release \ 1.42 + /etc/slitaz/slitaz.conf \ 1.43 + /etc/slitaz/tazpkg.conf \ 1.44 + /var/lib/tazpkg/mirrors \ 1.45 + /var/lib/tazpkg/packages.info \ 1.46 + /var/lib/tazpkg/descriptions.txt \ 1.47 + /var/lib/tazpkg/packages.equiv \ 1.48 + /var/lib/tazpkg/extra.list \ 1.49 + /var/lib/tazpkg/packages.list \ 1.50 + /var/lib/tazpkg/ID \ 1.51 + /var/lib/tazpkg/files.list.lzma \ 1.52 + /var/lib/tazpkg/files-list.md5 \ 1.53 + /var/lib/tazpkg/packages.up \ 1.54 + /var/lib/tazpkg/packages.txt \ 1.55 + /var/lib/tazpkg/packages.md5 \ 1.56 + /var/lib/tazpkg/mirror \ 1.57 + /var/lib/tazpkg/blocked-packages.list \ 1.58 + /var/lib/tazpkg/packages.desc \ 1.59 + /var/lib/tazpkg/installed.info \ 1.60 + /var/lib/tazpkg/IDs \ 1.61 + /var/log/slitaz/tazpkg.log 1.62 +do 1.63 + if [ ! -f "$ROOT$file" ]; then 1.64 + colorize 31 "ERROR. File $file absent. Exit test" 1.65 + exit 1 1.66 + fi 1.67 +done 1.68 + 1.69 +[ -n "$WARNING" ] && warning='(with warnings)' 1.70 +footer "$(colorize 32 "Test #01 passed $warning")" 1.71 +exit 0