]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests prove all tags have to match in lvs
authorAlfredo Deza <adeza@redhat.com>
Thu, 7 Sep 2017 21:00:22 +0000 (17:00 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 11 Sep 2017 19:26:17 +0000 (15:26 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 80e401ca970066541ae7255be1caf42883048df4)

src/ceph-volume/ceph_volume/tests/devices/lvm/test_api.py

index cfbe699b16e29d08ee7cf9b916b76db5e7f56fbf..abb1662c7b75fe1ab59d51f2f8b61b8fc0322369 100644 (file)
@@ -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)