[Ovirt-devel] [PATCH server] Fixed the tests for host-browser.
Darryl L. Pierce
dpierce at redhat.com
Thu Oct 2 13:05:04 UTC 2008
A change to the identify protocol was overlooked. When an empty value was
submitted, host-browser would throw an exception. But, a change allowed
empty values to get by without notice. Fixed.
Also added a BuildRequires dependency on ruby-flexmock so that the RPM is
correctly installed when building the server RPM.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
ovirt-server.spec.in | 1 +
src/host-browser/host-browser.rb | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in
index 114b52d..5650e01 100644
--- a/ovirt-server.spec.in
+++ b/ovirt-server.spec.in
@@ -36,6 +36,7 @@ Requires(preun): /sbin/service
BuildRequires: ruby >= 1.8.1
BuildRequires: ruby-devel
BuildRequires: rubygem(gettext)
+BuildRequires: ruby-flexmock
BuildRequires: rubygem(rake) >= 0.7
Provides: ovirt-server
BuildArch: noarch
diff --git a/src/host-browser/host-browser.rb b/src/host-browser/host-browser.rb
index 3adea03..2241614 100755
--- a/src/host-browser/host-browser.rb
+++ b/src/host-browser/host-browser.rb
@@ -46,10 +46,15 @@ class HostBrowser
def initialize(session)
@session = session
@keytab_dir = '/usr/share/ipa/html/'
+ set_peeraddr @session.peeraddr[3]
+ end
+
+ def set_peeraddr(peeraddr)
+ @peeraddr = peeraddr
end
def prefix(session)
- "#{Time.now.strftime('%b %d %H:%M:%S')} #{session.peeraddr[3]} "
+ "#{Time.now.strftime('%b %d %H:%M:%S')} #{@peeraddr} "
end
# Ensures the conversation starts properly.
@@ -113,7 +118,7 @@ class HostBrowser
nic_info << nic
else
- raise Exception.new("ERRINFO! Expected key=value : #{info}\n") unless info =~ /[\w]+[\s]*=[\w]*/
+ raise Exception.new("ERRINFO! Expected key=value : #{info}\n") unless info =~ /[\w]+[\s]*=[\w]+/
key, value = info.split("=")
--
1.5.5.1
More information about the ovirt-devel
mailing list