Title: [opsview] [9681] Add test for queryhost, based on failure seen on UAT
Revision
9681
Author
tvoon
Date
2012-08-01 01:01:39 +0100 (Wed, 01 Aug 2012)

Log Message

Add test for queryhost, based on failure seen on UAT

Modified Paths


Modified: trunk/opsview-web/t/825queryhost.t
===================================================================
--- trunk/opsview-web/t/825queryhost.t	2012-07-31 22:09:30 UTC (rev 9680)
+++ trunk/opsview-web/t/825queryhost.t	2012-08-01 00:01:39 UTC (rev 9681)
@@ -18,6 +18,9 @@
 use lib "$Bin/lib";
 use Opsview::TestUtils;
 
+use Runtime::Schema;
+my $runtime = Runtime::Schema->my_connect;
+
 my $content;
 my $mech = Test::WWW::Mechanize::Catalyst->new;
 
@@ -109,6 +112,23 @@
 $mech->get_ok( "http://localhost/state/host/998/queryhost" );
 $mech->content_like(qr/Host does not exist in configuration/);
 
+$runtime->storage->dbh_do(
+    sub {
+        my ( $storage, $dbh ) = @_;
+        $dbh->do(
+            "update opsview_host_objects set name2='Interface: Ethernet0-01' where object_id=160"
+        );
+        $dbh->do(
+            "update opsview_host_services set servicename='Interface: Ethernet0-01' where service_object_id=160"
+        );
+    },
+);
+
+$mech->get_ok( "http://localhost/state/host/120/queryhost" );
+$mech->content_contains( "title='UNKNOWN'",
+    "There should be one row with UNKNOWN set"
+);
+
 sub strip_docs_version {
     $_ = shift;
     s/opsview\d+\.\d+://g;

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to