Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 699499 Details for
Bug 910757
New function rlAssertBinaryOrigin
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
tests for the new functionality
0001-Added-tests-for-rpmAssertRpm-all-and-rpmAssertBinary.patch (text/plain), 3.34 KB, created by
Martin Kyral
on 2013-02-19 15:29:08 UTC
(
hide
)
Description:
tests for the new functionality
Filename:
MIME Type:
Creator:
Martin Kyral
Created:
2013-02-19 15:29:08 UTC
Size:
3.34 KB
patch
obsolete
>From bca74e2fb73f8af3b006f877290d338cdf8c0320 Mon Sep 17 00:00:00 2001 >From: Martin Kyral <mkyral@redhat.com> >Date: Tue, 19 Feb 2013 10:23:50 +0100 >Subject: [PATCH] Added tests for rpmAssertRpm --all and rpmAssertBinaryOrigin > >--- > src/test/rpmsTest.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 58 insertions(+) > >diff --git a/src/test/rpmsTest.sh b/src/test/rpmsTest.sh >index f183202..ae32fc4 100644 >--- a/src/test/rpmsTest.sh >+++ b/src/test/rpmsTest.sh >@@ -43,6 +43,34 @@ test_rlAssertRpm() { > "rlAssertRpm $first_n $first_v $first_r ${first_a}xyz" > > assertGoodBad "rlAssertRpm ahsgqyrg" 0 1 >+ >+ : > $OUTPUTFILE >+ local PACKAGES=$( rpm -qa --qf "%{NAME} " | awk '{ print $1 " " $2 }' ) >+ local PACKAGES2=$PACKAGES >+ local COLLECTIONS=$( rpm -qa --qf "%{NAME} " | awk '{ print $3 " " $4 }' ) >+ local REQUIRES=$( rpm -qa --qf "%{NAME} " | awk '{ print $5 " " $6 }' ) >+ >+ assertTrue "Running rlAssertRpm --all with PACKAGES=$PACKAGES COLLECTIONS=$COLLECTIONS REQUIRES=$REQUIRES" \ >+ "rlAssertRpm --all >$OUTPUTFILE" >+ >+ for pkg in $PACKAGES $COLLECTIONS $REQUIRES ; do >+ assertTrue "Checking log for $pkg" \ >+ "grep -q '$pkg' $OUTPUTFILE" >+ done >+ >+ unset PACKAGES >+ assertTrue "Running rlAssertRpm --all with PACKAGES=$PACKAGES COLLECTIONS=$COLLECTIONS REQUIRES=$REQUIRES" \ >+ "rlAssertRpm --all >$OUTPUTFILE" >+ >+ for pkg in $PACKAGES $COLLECTIONS $REQUIRES ; do >+ assertTrue "Checking log for $pkg" \ >+ "grep -q '$pkg' $OUTPUTFILE" >+ done >+ for pkg in $PACKAGES2 ; do >+ assertFalse "Checking log for not containing $pkg" \ >+ "grep -q '$pkg' $OUTPUTFILE" >+ done >+ > } > > test_rlAssertNotRpm() { >@@ -95,6 +123,7 @@ test_rlCheckRpm() { > assertTrue "Checking log for $first_n" \ > "grep -q '$first_n' $OUTPUTFILE" > >+ > assertRun "rlCheckRpm" 100 "rlCheckRpm returns non-0 when run without parameters" > > : > $OUTPUTFILE >@@ -115,3 +144,32 @@ test_rlCheckRpm() { > test_rlRpmPresent(){ > assertTrue "rlrpmPresent is reported to be obsoleted" "rlRpmPresent abcdefg 2>&1 >&- |grep -q obsolete" > } >+ >+test_rlAssertBinaryOrigin(){ >+ : > $OUTPUTFILE >+ >+ #existing binary command >+ assertTrue "rlAssertBinaryOrigin returns 0 on existing command owned by the package" \ >+ "rlAssertBinaryOrigin bash bash" >+ >+ #existing binary command in more packages >+ assertTrue "rlAssertBinaryOrigin returns 0 on existing command owned by one the packages" \ >+ "rlAssertBinaryOrigin bash bash ksh pdksh" >+ >+ #existing binary full path >+ assertTrue "rlAssertBinaryOrigin returns 0 on existing full path command owned by the package" \ >+ "rlAssertBinaryOrigin /bin/bash bash" >+ >+ #exisiting alternative >+ local PKG=$(rpm -qf $( ls -l $( ls -l /usr/bin | grep alternatives | head -n1 | awk '{ print $NF }' ) | awk '{ print $NF }' )) >+ local BIN=$( ls -l /usr/bin | grep alternatives | head -n1 | awk '{ print $9 }' ) >+ assertTrue "rlAssertBinaryOrigin returns 0 on existing alternative command owned by the packages" \ >+ "rlAssertBinaryOrigin $BIN $PKG" >+ >+ #binary not in package >+ assertRun "rlAssertBinaryOrigin bash glibc" 1 \ >+ "rlAssertBinaryOrigin returns 1 on existing full path command owned by different package" >+ #non-exisitng binary >+ assertRun "rlAssertBinaryOrigin command-not-found bash" 2 \ >+ "rlAssertBinaryOrigin returns 2 on non-existing command" >+} >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 910757
:
697868
|
699387
|
699498
|
699499
|
700562
|
702794
|
704988