From fce72434270cb1bdd14ff896cd1640bc51c93084 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 4 Jun 2013 11:07:18 +0200 Subject: [PATCH] tests: fix strings test For non udev path use DM_DEFAULT_NAME_MANGLING_MODE. Skip this test when using real /dev dir, since udev is not able to create such device name unless mangled... --- test/shell/mdata-strings.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/shell/mdata-strings.sh b/test/shell/mdata-strings.sh index 95a630e0f..0102d4b57 100644 --- a/test/shell/mdata-strings.sh +++ b/test/shell/mdata-strings.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2008-2011 Red Hat, Inc. All rights reserved. +# Copyright (C) 2008-2013 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions @@ -13,10 +13,15 @@ . lib/test -aux prepare_devs 2 -aux lvmconf 'devices/global_filter = [ "a|.*dev/mapper/.*LVMTEST.*pv[0-9_]*$|", "r|.*|" ]' +# For udev impossible to create +test "$LVM_TEST_DEVDIR" = "/dev" && skip + +aux prepare_devs 2 +aux extend_filter_LVMTEST + +# Setup mangling to 'none' globaly for all libdm users +export DM_DEFAULT_NAME_MANGLING_MODE=none -# for udev impossible to create pv_ugly="__\"!@#\$%^&*,()|@||'\\\"__pv1" # 'set up temp files, loopback devices' @@ -30,7 +35,8 @@ dm_table | grep -F "$pv_ugly" created="$dev1" # when used with real udev without fallback, it will fail here pvcreate "$dev1" || created="$dev2" -pvdisplay | should grep -F "$pv_ugly" +pvdisplay 2>&1 | tee >err +should grep -F "$pv_ugly" err should check pv_field "$dev1" pv_name "$dev1" vgcreate $vg "$created" # 'no parse errors and VG really exists'