help="use this teuthology branch instead of master",
default=os.getenv('TEUTH_BRANCH', 'master'),
)
+ parser.add_argument(
+ '--ceph-workbench-git-url',
+ help="git clone url for ceph-workbench",
+ )
+ parser.add_argument(
+ '--ceph-workbench-branch',
+ help="use this ceph-workbench branch instead of master",
+ default='master',
+ )
parser.add_argument(
'--upload',
action='store_true', default=False,
'--suite-branch',
'--ceph-repo',
'--ceph',
+ '--ceph-workbench-branch',
+ '--ceph-workbench-git-url',
'--archive-upload',
'--archive-upload-url',
'--key-name',
clone = ("git clone -b {branch} {url}".format(
branch=self.args.teuthology_branch,
url=self.args.teuthology_git_url))
+ ceph_workbench = ''
+ if self.args.ceph_workbench_git_url:
+ ceph_workbench += (" --ceph-workbench-branch " +
+ self.args.ceph_workbench_branch)
+ ceph_workbench += (" --ceph-workbench-git-url " +
+ self.args.ceph_workbench_git_url)
log.debug("OPENRC = " + openrc + " " +
"TEUTHOLOGY_USERNAME = " + self.username + " " +
"CLONE_OPENSTACK = " + clone + " " +
"UPLOAD = " + upload + " " +
+ "CEPH_WORKBENCH = " + ceph_workbench + " " +
"NWORKERS = " + str(self.args.simultaneous_jobs))
content = (template.
replace('OPENRC', openrc).
replace('TEUTHOLOGY_USERNAME', self.username).
replace('CLONE_OPENSTACK', clone).
replace('UPLOAD', upload).
+ replace('CEPH_WORKBENCH', ceph_workbench).
replace('NWORKERS', str(self.args.simultaneous_jobs)))
open(path, 'w').write(content)
log.debug("get_user_data: " + content + " written to " + path)
runcmd:
- su - -c '(set -x ; CLONE_OPENSTACK && cd teuthology && ./bootstrap install)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
- echo 'export OPENRC' | tee /home/TEUTHOLOGY_USERNAME/openrc.sh
- - su - -c '(set -x ; source openrc.sh ; cd teuthology ; source virtualenv/bin/activate ; openstack keypair delete teuthology || true ; teuthology/openstack/setup-openstack.sh --nworkers NWORKERS UPLOAD --setup-all)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
+ - su - -c '(set -x ; source openrc.sh ; cd teuthology ; source virtualenv/bin/activate ; openstack keypair delete teuthology || true ; teuthology/openstack/setup-openstack.sh --nworkers NWORKERS UPLOAD CEPH_WORKBENCH --setup-all)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
- /etc/init.d/teuthology restart
final_message: "teuthology is up and running after $UPTIME seconds"
crontab -r
}
+function setup_ceph_workbench() {
+ local url=$1
+ local branch=$2
+
+ (
+ cd $HOME
+ source teuthology/virtualenv/bin/activate
+ if test "$url" ; then
+ git clone -b $branch $url
+ cd ceph-workbench
+ python setup.py install
+ else
+ pip install ceph-workbench
+ fi
+ )
+}
+
function get_or_create_keypair() {
local keypair=$1
local flavor_select
local keypair=teuthology
local archive_upload
+ local ceph_workbench_git_url
+ local ceph_workbench_branch
local do_setup_keypair=false
+ local do_ceph_workbench=false
local do_create_config=false
local do_setup_dnsmasq=false
local do_install_packages=false
shift
archive_upload=$1
;;
+ --ceph-workbench-git-url)
+ shift
+ ceph_workbench_git_url=$1
+ ;;
+ --ceph-workbench-branch)
+ shift
+ ceph_workbench_branch=$1
+ ;;
--install)
do_install_packages=true
;;
--setup-keypair)
do_setup_keypair=true
;;
+ --setup-ceph-workbench)
+ do_ceph_workbench=true
+ ;;
--setup-dnsmasq)
do_setup_dnsmasq=true
;;
;;
--setup-all)
do_install_packages=true
+ do_ceph_workbench=true
do_create_config=true
do_setup_keypair=true
do_setup_dnsmasq=true
setup_crontab || return 1
fi
+ if $do_ceph_workbench ; then
+ setup_ceph_workbench $ceph_workbench_git_url $ceph_workbench_branch || return 1
+ fi
+
if $do_setup_keypair ; then
get_or_create_keypair $keypair || return 1
fi
argv = (self.options +
['--teuthology-git-url', 'TEUTHOLOGY_URL',
'--teuthology-branch', 'TEUTHOLOGY_BRANCH',
+ '--ceph-workbench-git-url', 'CEPH_WORKBENCH_URL',
+ '--ceph-workbench-branch', 'CEPH_WORKBENCH_BRANCH',
'--upload',
'--archive-upload', archive_upload] +
teuthology_argv)
assert "nworkers=" + str(args.simultaneous_jobs) in l
assert "username=" + teuthology.username in l
assert "upload=--archive-upload user@archive:/tmp" in l
+ assert ("ceph_workbench="
+ " --ceph-workbench-branch CEPH_WORKBENCH_BRANCH"
+ " --ceph-workbench-git-url CEPH_WORKBENCH_URL") in l
assert "clone=git clone -b TEUTHOLOGY_BRANCH TEUTHOLOGY_URL" in l
assert os.environ['OS_AUTH_URL'] in l
assert " ".join(teuthology_argv) in l
system_info:
default_user:
name: ubuntu
-final_message: "teuthology is up and running after $UPTIME seconds, substituded variables nworkers=NWORKERS openrc=OPENRC username=TEUTHOLOGY_USERNAME upload=UPLOAD clone=CLONE_OPENSTACK"
+final_message: "teuthology is up and running after $UPTIME seconds, substituded variables nworkers=NWORKERS openrc=OPENRC username=TEUTHOLOGY_USERNAME upload=UPLOAD ceph_workbench=CEPH_WORKBENCH clone=CLONE_OPENSTACK"