blob: 95443df33df2301b61d1d9f6bdd9b4547282ab04 [file] [log] [blame]
Todd Willey3e6ec232011-11-04 12:23:35 -04001#!/usr/bin/env bash
2
3# Test swift via the command line tools that ship with it.
4
5# This script exits on an error so that errors don't compound and you see
6# only the first error that occured.
7set -o errexit
8
9# Print the commands being run so that we can see the command that triggers
10# an error. It is also useful for following allowing as the install occurs.
11set -o xtrace
12
13
14# Settings
15# ========
16
17# Use openrc + stackrc + localrc for settings
18pushd $(cd $(dirname "$0")/.. && pwd)
19source ./openrc
20popd
21
22
23# Testing Swift
24# =============
25
26# Check if we have to swift via keystone
Chmouel Boudjnaha6bdfdd2012-02-29 14:11:01 +000027swift stat
Todd Willey3e6ec232011-11-04 12:23:35 -040028
29# We start by creating a test container
Chmouel Boudjnaha6bdfdd2012-02-29 14:11:01 +000030swift post testcontainer
Todd Willey3e6ec232011-11-04 12:23:35 -040031
32# add some files into it.
Chmouel Boudjnaha6bdfdd2012-02-29 14:11:01 +000033swift upload testcontainer /etc/issue
Todd Willey3e6ec232011-11-04 12:23:35 -040034
35# list them
Chmouel Boudjnaha6bdfdd2012-02-29 14:11:01 +000036swift list testcontainer
Todd Willey3e6ec232011-11-04 12:23:35 -040037
38# And we may want to delete them now that we have tested that
39# everything works.
Chmouel Boudjnaha6bdfdd2012-02-29 14:11:01 +000040swift delete testcontainer