From fa9cd660c9f516f03ddf8ae269b0dcd277f895b4 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Wed, 27 Jan 2016 11:48:58 -0500 Subject: [PATCH] librgw: remove deprecated/unused librgw personality Signed-off-by: Matt Benjamin --- src/test/Makefile-client.am | 12 ----- src/test/librgw.cc | 103 ------------------------------------ src/test/librgw_link.cc | 20 ------- 3 files changed, 135 deletions(-) delete mode 100644 src/test/librgw.cc delete mode 100644 src/test/librgw_link.cc diff --git a/src/test/Makefile-client.am b/src/test/Makefile-client.am index bd7ec250da45a..612eee9660101 100644 --- a/src/test/Makefile-client.am +++ b/src/test/Makefile-client.am @@ -614,18 +614,6 @@ test_build_librgw_CXXFLAGS = $(AM_CXXFLAGS) bin_DEBUGPROGRAMS += test_build_librgw endif # WITH_BUILD_TESTS -#unittest_librgw_link_SOURCES = test/librgw_link.cc -#unittest_librgw_link_LDFLAGS = $(PTHREAD_CFLAGS) ${AM_LDFLAGS} -#unittest_librgw_link_LDADD = $(LIBRGW) ${UNITTEST_LDADD} -#unittest_librgw_link_CXXFLAGS = ${CRYPTO_CFLAGS} ${AM_CXXFLAGS} ${UNITTEST_CXXFLAGS} -#check_TESTPROGRAMS += unittest_librgw_link - -#unittest_librgw_SOURCES = test/librgw.cc -#unittest_librgw_LDFLAGS = -lrt $(PTHREAD_CFLAGS) -lcurl ${AM_LDFLAGS} -#unittest_librgw_LDADD = librgw.la $(LIBRADOS) ${UNITTEST_LDADD} -lexpat $(CEPH_GLOBAL) -#unittest_librgw_CXXFLAGS = ${CRYPTO_CFLAGS} ${AM_CXXFLAGS} ${UNITTEST_CXXFLAGS} -#check_TESTPROGRAMS += unittest_librgw - ceph_test_cors_SOURCES = test/test_cors.cc ceph_test_cors_LDADD = \ $(LIBRADOS) $(LIBRGW) $(CEPH_GLOBAL) \ diff --git a/src/test/librgw.cc b/src/test/librgw.cc deleted file mode 100644 index 5a360a7b4100b..0000000000000 --- a/src/test/librgw.cc +++ /dev/null @@ -1,103 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2011 New Dream Network - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#include "include/rados/librgw.h" - -#include "gtest/gtest.h" - -#include - -static const char SAMPLE_XML_1[] = \ -"\n\ - \n\ - foo\n\ - MrFoo\n\ - \n\ - \n\ - \n\ - \n\ - bar\n\ - display-name\n\ - \n\ - FULL_CONTROL\n\ - \n\ - \n\ -"; - -static const uint8_t VERSION1_BIN[] = { - 0x01, 0x01, 0x07, 0x00, 0x00, 0x00, 0x63, 0x6d, - 0x63, 0x63, 0x61, 0x62, 0x65, 0x07, 0x00, 0x00, - 0x00, 0x63, 0x6d, 0x63, 0x63, 0x61, 0x62, 0x65, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x6d, - 0x63, 0x63, 0x61, 0x62, 0x65, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, - 0x6d, 0x63, 0x63, 0x61, 0x62, 0x65, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, - 0x6d, 0x63, 0x63, 0x61, 0x62, 0x65, 0x0a, 0x0a -}; - -TEST(LibRGW, FromBin) { - int ret; - const char *bin = (const char*)VERSION1_BIN; - int len = sizeof(VERSION1_BIN) / sizeof(VERSION1_BIN[0]); - librgw_t rgw; - - ret = librgw_create(&rgw, NULL); - ASSERT_EQ(ret, 0); - - char *xml = NULL; - ret = librgw_acl_bin2xml(rgw, bin, len, &xml); - ASSERT_EQ(ret, 0); - - librgw_shutdown(rgw); -} - -TEST(LibRGW, RoundTrip) { - - int ret; - char *bin = NULL; - int bin_len = 0; - librgw_t rgw; - - ret = librgw_create(&rgw, NULL); - ASSERT_EQ(ret, 0); - - ret = librgw_acl_xml2bin(rgw, SAMPLE_XML_1, &bin, &bin_len); - ASSERT_EQ(ret, 0); - - char *xml2 = NULL; - ret = librgw_acl_bin2xml(rgw, bin, bin_len, &xml2); - ASSERT_EQ(ret, 0); - - char *bin2 = NULL; - int bin_len2 = 0; - ret = librgw_acl_xml2bin(rgw, xml2, &bin2, &bin_len2); - ASSERT_EQ(ret, 0); - - // the serialized representation should be the same. - ASSERT_EQ(bin_len, bin_len2); - ASSERT_EQ(memcmp(bin, bin2, bin_len), 0); - - // Free memory - // As you can see, we ignore freeing memory on test failures - // Don't do this in your real programs! - librgw_free_bin(rgw, bin); - librgw_free_xml(rgw, xml2); - librgw_free_bin(rgw, bin2); - - librgw_shutdown(rgw); -} diff --git a/src/test/librgw_link.cc b/src/test/librgw_link.cc deleted file mode 100644 index f655a1e5030cb..0000000000000 --- a/src/test/librgw_link.cc +++ /dev/null @@ -1,20 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2011 New Dream Network - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#include "gtest/gtest.h" - -TEST(LibrgwConfig, Link) { -} - - -- 2.39.5