clean up saio env after running func tests

Current tests from upstream swift leave containers in the
database after they are done running.

This causes an issue with sof tests because we clean up the
tests directory /mnt/swiftonfile. When running the
functional tests a second time always fails because the
setup functions tries to delete existing containers,
but the sof object servers returns 404, thus causing
the whole test to fail.

Signed-off-by: Thiago da Silva <thiago@redhat.com>
This commit is contained in:
Thiago da Silva 2014-07-11 15:06:58 -04:00
parent eeb164ac2d
commit 068f6000e9

View File

@ -32,7 +32,8 @@ from shutil import rmtree
from tempfile import mkdtemp
from test import get_config
from test.functional.swift_test_client import Connection, ResponseError
from test.functional.swift_test_client import Account, Connection, \
ResponseError
# This has the side effect of mocking out the xattr module so that unit tests
# (and in this case, when in-process functional tests are called for) can run
# on file systems that don't support extended attributes.
@ -507,6 +508,11 @@ def teardown_package():
global orig_collate
locale.setlocale(locale.LC_COLLATE, orig_collate)
conn = Connection(config)
conn.authenticate()
account = Account(conn, config.get('account', config['username']))
account.delete_containers()
global in_process
if in_process:
try: