summaryrefslogtreecommitdiffstats
path: root/src/yum/test/test_common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/yum/test/test_common.sh')
-rw-r--r--src/yum/test/test_common.sh91
1 files changed, 0 insertions, 91 deletions
diff --git a/src/yum/test/test_common.sh b/src/yum/test/test_common.sh
deleted file mode 100644
index 1e5cd98..0000000
--- a/src/yum/test/test_common.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/bash
-
-if [ -z $CLASS_NAME ]; then
- echo "variable CLASS_NAME must be defined"
- exit 1
-fi
-
-
-url="http://localhost:5988"
-
-fedora_release=`sed 's/Fedora release\s*\([0-9]\+\).*/\1/' \
- /etc/fedora-release`
-
-function make_nevra() {
- # accepts arguments: name, epoch, ver, rel, arch
- # in this order
- printf "%s-%s:%s-%s.%s" $@
-}
-
-function make_op() {
- local class_name keys
- read class_name keys <<< "$@"
- [ -n "$keys" ] && keys=".$keys"
- printf "root/cimv2:$class_name$keys"
-}
-
-computer_system_keys="CreationClassName=\"Linux_ComputerSystem\""
-computer_system_keys+=",Name=$(hostname)"
-computer_system_op=`make_op Linux_ComputerSystem "$computer_system_keys"`
-op=`make_op ${CLASS_NAME}`
-
-function make_rpm_name() {
- local name epoch ver rel arch;
- if [ $# -ge 5 ]; then
- read name epoch ver rel arch <<< "$@"
- else
- read name ver rel arch <<< "$@"
- fi
- [ $# -gt 5 ] && arch=`echo $arch | cut -d \ -f 1`
- if [ -n "$epoch" -a "$epoch" != 0 ]; then
- epoch="${epoch}:"
- else
- epoch=""
- fi
- printf "%s-%s%s-%s.%s.rpm" "$name" "$epoch" "$ver" "$rel" "$arch"
-}
-
-function is_installed() {
- rpm -q "$1" >/dev/null
-}
-
-function is_installed_nevra() {
- local name epoch ver rel arch;
- read name epoch ver rel arch <<< "$@"
-
- rpm -qi name | sed -n 's/^\(Name\|Epoch\|Version\|Release\|Architecture\)\s*:\s*\(.*\)/\1 \2/p' | \
- while read l; do
- read k v <<< "$l"
- read ${k,,} <<< "$v"
- [ $k == "version" ] && [ -z "$epoch" ] && echo "0" # print epoch
- echo $v
- done | set --
- [ $epoch == $2 ] && [ $ver == $3 ] && [ $rel == $4 ] && [ $arch == $5 ]
-}
-
-function install_pkg() {
- if [ $# == 1 ]; then
- sudo yum -y install $1 || exit 1
- else
- local rpm_name=`make_rpm_name "$@"`
- if ! [ -f "$rpm_name" ]; then
- if [ -f "$dir/$rpm_name" ]; then
- rpm_name="$dir/$rpm_name"
- fi
- fi
- if ! [ -e "$rpm_name" ]; then
- sudo yum -y install "$1"
- else
- sudo rpm -i "$rpm_name"
- fi
- fi
-}
-
-function remove() {
- sudo rpm --allmatches -e "$1"
-}
-
-function wbemerr() {
- wbemcli "$@" |& sed 's:<br\s*/\?>:\n:g'
-}
-