X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fdevices%2Fsimple%2Ftest_trigger.py;fp=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fdevices%2Fsimple%2Ftest_trigger.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=d3220f2b046f6d0ffe84b36ff1b7291c31fef3d6;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_trigger.py b/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_trigger.py deleted file mode 100644 index d3220f2..0000000 --- a/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_trigger.py +++ /dev/null @@ -1,45 +0,0 @@ -import pytest -from ceph_volume import exceptions -from ceph_volume.devices.simple import trigger - - -class TestParseOSDid(object): - - def test_no_id_found_if_no_digit(self): - with pytest.raises(exceptions.SuffixParsingError): - trigger.parse_osd_id('asdlj-ljahsdfaslkjhdfa') - - def test_no_id_found(self): - with pytest.raises(exceptions.SuffixParsingError): - trigger.parse_osd_id('ljahsdfaslkjhdfa') - - def test_id_found(self): - result = trigger.parse_osd_id('1-ljahsdfaslkjhdfa') - assert result == '1' - - -class TestParseOSDUUID(object): - - def test_uuid_is_parsed(self): - result = trigger.parse_osd_uuid('1-asdf-ljkh-asdf-ljkh-asdf') - assert result == 'asdf-ljkh-asdf-ljkh-asdf' - - def test_uuid_is_parsed_longer_sha1(self): - result = trigger.parse_osd_uuid('1-foo-bar-asdf-ljkh-asdf-ljkh-asdf') - assert result == 'foo-bar-asdf-ljkh-asdf-ljkh-asdf' - - def test_uuid_is_not_found(self): - with pytest.raises(exceptions.SuffixParsingError): - trigger.parse_osd_uuid('ljahsdfaslkjhdfa') - - def test_uuid_is_not_found_missing_id(self): - 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' - -