Esempio n. 1
0
 def test_ceph(self):
     tmp_rootdir = self._get_tmpdir_for_xattr()
     a = self.useFixture(ceph.CephDriver(tmp_rootdir=tmp_rootdir))
     self.assertEqual("ceph://localhost:%d" % a.port,
                      os.getenv("PIFPAF_URL"))
     self.assertIn("ceph.conf", os.getenv("CEPH_CONF"))
     self.assertIn("ceph.conf", os.getenv("PIFPAF_CEPH_CONF"))
Esempio n. 2
0
    def test_ceph(self):
        tempdir = self.useFixture(fixtures.TempDir()).path
        driver = ceph.CephDriver()
        try:
            driver._ensure_xattr_support(tempdir)
        except RuntimeError as e:
            self.skipTest(str(e))

        a = self.useFixture(driver)
        self.assertEqual("ceph://localhost:%d" % a.port,
                         os.getenv("PIFPAF_URL"))
        self.assertIn("ceph.conf", os.getenv("CEPH_CONF"))
        self.assertIn("ceph.conf", os.getenv("PIFPAF_CEPH_CONF"))
Esempio n. 3
0
    def test_gnocchi_with_existing_ceph(self):
        port = gnocchi.GnocchiDriver.DEFAULT_PORT + 10
        tmp_rootdir = self._get_tmpdir_for_xattr()
        ceph_driver = ceph.CephDriver(tmp_rootdir=tmp_rootdir)
        self.useFixture(ceph_driver)

        ceph_driver._exec(["rados", "-c", os.getenv("CEPH_CONF"), "mkpool",
                           "gnocchi"]),

        self.useFixture(gnocchi.GnocchiDriver(
            storage_url="ceph://%s" % os.getenv("CEPH_CONF"),
            port=port))
        self.assertEqual("gnocchi://localhost:%d" % port,
                         os.getenv("PIFPAF_URL"))
        r = requests.get("http://localhost:%d/" % port)
        self.assertEqual(200, r.status_code)
Esempio n. 4
0
    def test_gnocchi_with_existing_ceph(self):
        port = gnocchi.GnocchiDriver.DEFAULT_PORT + 10
        tempdir = self.useFixture(fixtures.TempDir()).path

        ceph_driver = ceph.CephDriver()
        try:
            ceph_driver._ensure_xattr_support(tempdir)
        except RuntimeError as e:
            self.skipTest(str(e))
        self.useFixture(ceph_driver)

        ceph_driver._exec(
            ["rados", "-c",
             os.getenv("CEPH_CONF"), "mkpool", "gnocchi"]),

        self.useFixture(
            gnocchi.GnocchiDriver(storage_url="ceph://%s" %
                                  os.getenv("CEPH_CONF"),
                                  port=port))
        self.assertEqual("gnocchi://localhost:%d" % port,
                         os.getenv("PIFPAF_URL"))
        r = requests.get("http://localhost:%d/" % port)
        self.assertEqual(200, r.status_code)