From 80e401ca970066541ae7255be1caf42883048df4 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 7 Sep 2017 17:00:22 -0400 Subject: [PATCH] ceph-volume tests prove all tags have to match in lvs Signed-off-by: Alfredo Deza --- .../ceph_volume/tests/devices/lvm/test_api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 cfbe699b16e..abb1662c7b7 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) -- 2.47.3