tstRTS3.cpp revision c7814cf6e1240a519cbec0441e033d0e2470ed00
/* $Id$ */
/** @file
* IPRT Testcase - Simple Storage Service (S3) Communication API
*/
/*
* Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <iprt/initterm.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/* Manual configuration of this testcase */
#define TSTS3_CREATEBUCKET
#define TSTS3_PUTGETKEY
//#define TSTS3_SHOWPROGRESS
#ifdef TSTS3_CREATEBUCKET
//# define TSTS3_CREATEBUCKET_BUCKETNAME "tstS3CreateBucket"
# define TSTS3_CREATEBUCKET_BUCKETNAME "tt9"
#endif /* TSTS3_CREATEBUCKET */
#ifdef TSTS3_PUTGETKEY
# define TSTS3_PUTGETKEY_BUCKETNAME "tstS3PutGetBucket"
# define TSTS3_PUTGETKEY_KEYNAME "tstS3PutGetKey"
# define TSTS3_PUTGETKEY_PUTFILE "tstS3"
# define TSTS3_PUTGETKEY_GETFILE "tstS3_fetched"
#endif /* TSTS3_PUTGETKEY */
{
#ifdef TSTS3_SHOWPROGRESS
#endif /* TSTS3_SHOWPROGRESS */
return VINF_SUCCESS;
}
{
/* Fetch all available buckets */
char pszTitle[] = "RTS3GetBuckets";
if (RT_SUCCESS(rc))
{
if (pBuckets)
{
while (pBuckets)
{
}
}
else
}
else
}
{
/* Create the bucket */
char pszTitle[] = "RTS3CreateBucket";
if (RT_FAILURE(rc))
}
{
/* Delete the bucket */
char pszTitle[] = "RTS3DeleteBucket";
if (RT_FAILURE(rc))
}
{
/* Fetch all available keys of a specific bucket */
char pszTitle[] = "RTS3GetBucketKeys";
if (RT_SUCCESS(rc))
{
if (pKeys)
{
while (pKeys)
{
RTTestIPrintf(RTTESTLVL_ALWAYS, " > %s, %s, %lu\n", pKeys->pszName, pKeys->pszLastModified, pKeys->cbFile);
}
}
else
}
else
}
{
/* Delete the key */
char pszTitle[] = "RTS3DeleteKey";
if (RT_FAILURE(rc))
}
{
/* Fetch the content of a key */
RTTestIPrintf(RTTESTLVL_ALWAYS, " Get key '%s' from bucket '%s' into '%s' ...\n", pszKeyName, pszBucketName, pszFilename);
char pszTitle[] = "RTS3GetKey";
if (RT_FAILURE(rc))
}
{
/* Fetch the content of a key */
RTTestIPrintf(RTTESTLVL_ALWAYS, " Put '%s' into key '%s' in bucket '%s' ...\n", pszFilename, pszKeyName, pszBucketName);
char pszTitle[] = "RTS3PutKey";
if (RT_FAILURE(rc))
}
{
/*
* Initialize IPRT and create the test.
*/
if (rc)
return rc;
/*
* If no args, display usage.
*/
if (argc <= 2)
{
}
if (RT_FAILURE(rc))
{
return RTTestSummaryAndDestroy(hTest);
}
#ifdef TSTS3_CREATEBUCKET
#endif /* TSTS3_CREATEBUCKET */
#ifdef TSTS3_PUTGETKEY
#endif /* TSTS3_PUTGETKEY */
/*
* Summary
*/
return RTTestSummaryAndDestroy(hTest);
}