[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 5/6] ts-host-ping-check: New ubiquitous test step



Check that packet loss is within acceptable levels.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-run-job         |    2 ++
 ts-host-ping-check |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100755 ts-host-ping-check

diff --git a/sg-run-job b/sg-run-job
index a1ff24b..3bdb5aa 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -51,8 +51,10 @@ proc run-job {job} {
     if {$ok} { setstatus running                                          }
 
     per-host-ts broken  host-install/@(*) ts-host-install-twice
+    per-host-ts .       host-ping-check-native/@ ts-host-ping-check
     per-host-ts .       xen-install/@     ts-xen-install
     per-host-ts .       xen-boot/@        ts-host-reboot
+    per-host-ts .       host-ping-check-xen/@ ts-host-ping-check
 
     per-host-ts .       =(*)             {ts-leak-check basis}
 
diff --git a/ts-host-ping-check b/ts-host-ping-check
new file mode 100755
index 0000000..74c008c
--- /dev/null
+++ b/ts-host-ping-check
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use Osstest;
+use DBI;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+$_ = `ping -D -i 0.2 -c 100 $ho->{Ip} | tee /dev/stderr`;
+
+m/\b([0-9.]+)% packet loss\b/ or die "$_ ?";
+
+my $loss= $1;
+
+logm("packet loss $loss\%");
+
+die if $loss > 1;
+
+logm("ok.");
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.