From: Alfredo Deza Date: Thu, 7 Sep 2017 21:00:22 +0000 (-0400) Subject: ceph-volume tests prove all tags have to match in lvs X-Git-Tag: v12.2.1~45^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fafc161e1f6c825930c0848c32fa06b1d5edc849;p=ceph.git ceph-volume tests prove all tags have to match in lvs Signed-off-by: Alfredo Deza (cherry picked from commit 80e401ca970066541ae7255be1caf42883048df4) --- diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_api.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_api.py index cfbe699b16e2..abb1662c7b75 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_api.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_api.py @@ -184,6 +184,16 @@ class TestVolumes(object): assert len(volumes) == 1 assert volumes[0].lv_name == 'volume1' + def test_filter_by_tag_does_not_match_one(self, volumes): + lv_tags = "ceph.type=data,ceph.fsid=000-aaa" + osd = api.Volume(lv_name='volume1', lv_path='/dev/vg/lv', lv_tags=lv_tags) + journal = api.Volume(lv_name='volume2', lv_path='/dev/vg/lv', lv_tags='ceph.osd_id=1,ceph.type=journal') + volumes.append(osd) + volumes.append(journal) + # note the different osd_id! + volumes.filter(lv_tags={'ceph.type': 'data', 'ceph.osd_id': '2'}) + assert volumes == [] + def test_filter_by_vg_name(self, volumes): lv_tags = "ceph.type=data,ceph.fsid=000-aaa" osd = api.Volume(lv_name='volume1', vg_name='ceph_vg', lv_tags=lv_tags)