From 7cdf1772d69e85646a55202c4faac1d0aaace5c4 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 11 Sep 2017 12:30:34 -0400 Subject: [PATCH] ceph-volume tests catch improper parsing of osd uuid When the osd ID existed in the UUID in the same format (e.g. '1-') the parsing would break returning a bogus UUID that is impossible to find Signed-off-by: Alfredo Deza (cherry picked from commit 5392697121ef150f0edac05df14d116cf0148593) --- .../ceph_volume/tests/devices/lvm/test_trigger.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py index f1dff2d32dd6c..b5280f931bfdb 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py @@ -36,4 +36,10 @@ class TestParseOSDUUID(object): with pytest.raises(exceptions.SuffixParsingError): trigger.parse_osd_uuid('ljahs-dfa-slkjhdfa-foo') + def test_robust_double_id_in_uuid(self): + # it is possible to have the id in the SHA1, this should + # be fine parsing that + result = trigger.parse_osd_uuid("1-abc959fd-1ec9-4864-b141-3154f9b9f8ed") + assert result == 'abc959fd-1ec9-4864-b141-3154f9b9f8ed' + -- 2.39.5