From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 09/12] ts-guests-nbd-mirror: add checkaccessible test Date: Tue, 11 Feb 2014 15:25:51 +0000 Message-ID: <1392132354-7594-10-git-send-email-ian.jackson@eu.citrix.com> References: <1392132354-7594-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WDFEC-00089c-EU for xen-devel@lists.xenproject.org; Tue, 11 Feb 2014 15:26:28 +0000 In-Reply-To: <1392132354-7594-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org If the NBD devices are not properly accessible on the client, bomb out here rather than futilely starting a guest, and then timing out when the guest fails to boot because it can't find its root fs. Signed-off-by: Ian Jackson --- ts-guests-nbd-mirror | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ts-guests-nbd-mirror b/ts-guests-nbd-mirror index c0a021a..af200f4 100755 --- a/ts-guests-nbd-mirror +++ b/ts-guests-nbd-mirror @@ -116,7 +116,18 @@ sub shuffleconfigs () { } } +sub checkaccessible () { + foreach my $v (@vols) { + my $finfo = target_cmd_output_root($cho, "file -Ls $v->{Path}"); + chomp $finfo; + logm("file(1) on $v->{Path}: $finfo"); + die "unexpected contents for $v->{Path}, nbd failed?" + unless $finfo =~ m/filesystem|swap/i; + } +} + findvols(); configserver(); configclient(); shuffleconfigs(); +checkaccessible(); -- 1.7.10.4