Revive bashate tox test

- This patch fixes bashate errors.
- Bashate will ignore E006 check (Lines too long)

Change-Id: I257157a7a2cd55437e95b926ae4a7ada2a41ada5
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud
2015-10-13 13:48:42 +02:00
parent 8f02c57f7a
commit bb7a70f0b6
7 changed files with 30 additions and 22 deletions

View File

@@ -203,7 +203,7 @@ sysctl \
function deploy-ramdisk {
if [ ! -f $DEPLOY_NAME.initramfs -o \
! -f $DEPLOY_NAME.kernel ]; then
! -f $DEPLOY_NAME.kernel ]; then
ramdisk-image-create \
-a $NODE_ARCH \
-o $DEPLOY_NAME \
@@ -216,7 +216,7 @@ fi
function discovery-ramdisk {
if [ ! -f $DISCOVERY_NAME.initramfs -o \
! -f $DISCOVERY_NAME.kernel ]; then
! -f $DISCOVERY_NAME.kernel ]; then
ramdisk-image-create \
-a $NODE_ARCH \
-o $DISCOVERY_NAME \

View File

@@ -30,4 +30,4 @@ export OS_TENANT_NAME=$OS_TENANT_NAME
export OS_NO_CACHE=True
export OS_CLOUDNAME=overcloud
export no_proxy=${no_proxy:-''},$OVERCLOUD_IP
EOF
EOF

View File

@@ -20,7 +20,7 @@ TEMPEST=
# token expiry, which is increased from the default 1 hour to 4.
TIMEOUT=240
function show_options () {
function show_options {
echo "Usage: $SCRIPT_NAME [options]"
echo
echo "Deploys an Overcloud."
@@ -34,7 +34,10 @@ function show_options () {
}
TEMP=$(getopt -o ,h -l,tuskar,timeout:,tempest,help -n $SCRIPT_NAME -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
if [ $? != 0 ]; then
echo "Terminating..." >&2;
exit 1;
fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
@@ -155,9 +158,9 @@ fi
# NOTE(gfidente): Taken from
# https://github.com/ceph/ceph-deploy/blob/master/ceph_deploy/new.py#L21
function create_cephx_key() {
local KEY=$(python -c 'import base64,os,struct,time;key = os.urandom(16);header = struct.pack("<hiih", 1, int(time.time()), 0, len(key));print(base64.b64encode(header + key))')
echo $KEY
function create_cephx_key {
local KEY=$(python -c 'import base64,os,struct,time;key = os.urandom(16);header = struct.pack("<hiih", 1, int(time.time()), 0, len(key));print(base64.b64encode(header + key))')
echo $KEY
}
if [ -n "$TUSKAR" ]; then
@@ -415,7 +418,7 @@ else
"CephStorageCount": '${CEPHSTORAGESCALE}',
"BlockStorageCount": '${BLOCKSTORAGESCALE}',
"ObjectStorageCount": '${SWIFTSTORAGESCALE}'
}' <<< $ENV_JSON)
}' <<< $ENV_JSON)
jq . > "${HEAT_ENV}" <<< $ENV_JSON
chmod 0600 "${HEAT_ENV}"
@@ -517,6 +520,6 @@ nova flavor-create m1.demo auto 512 10 1
echo "Overcloud Deployed"
if [ -n "$TEMPEST" ]; then
TEMPEST_ARGS=${TEMPEST_ARGS:-} $(dirname $0)/instack-tempest-test-overcloud
$(dirname $0)/instack-test-overcloud
TEMPEST_ARGS=${TEMPEST_ARGS:-} $(dirname $0)/instack-tempest-test-overcloud
$(dirname $0)/instack-test-overcloud
fi

View File

@@ -14,7 +14,7 @@ fi
# NOTE(dtantsur): last working API version
export IRONIC_API_VERSION="1.6"
function show_options () {
function show_options {
echo "Usage: $SCRIPT_NAME [options]"
echo
echo "Deploys instances via Ironic in preparation for an Overcloud deployment."
@@ -44,7 +44,10 @@ function show_options () {
}
TEMP=$(getopt -o ,h -l,register-nodes,nodes-json:,discover-nodes,configure-nodes,deploy-nodes,help,setup-flavors,show-profile,check-ssh,delete-stack,delete-nodes,config-tools-provision -o,x,h -n $SCRIPT_NAME -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
if [ $? != 0 ]; then
echo "Terminating..." >&2;
exit 1;
fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"

View File

@@ -25,7 +25,7 @@ scenario.ssh_user cirros
FULL_TEMPEST_ARGS="--no-virtual-env"
if [ -n "$TEMPEST_ARGS" ]; then
FULL_TEMPEST_ARGS="$FULL_TEMPEST_ARGS -- $TEMPEST_ARGS"
FULL_TEMPEST_ARGS="$FULL_TEMPEST_ARGS -- $TEMPEST_ARGS"
fi
./run_tempest.sh $FULL_TEMPEST_ARGS 2>&1 | tee ~/tempest/tempest-run.log

View File

@@ -10,8 +10,8 @@ IMAGE_PATH='.'
# tripleo os-adduser -p $OVERCLOUD_DEMO_PASSWORD demo demo@example.com
if ! glance image-show user 2>&1 1>/dev/null; then
glance image-create --name user --is-public True --disk-format qcow2 \
--container-format bare --file $IMAGE_PATH/fedora-user.qcow2
glance image-create --name user --is-public True --disk-format qcow2 \
--container-format bare --file $IMAGE_PATH/fedora-user.qcow2
fi
tripleo wait_for 30 10 nova service-list --binary nova-compute 2\>/dev/null \| grep 'enabled.*\ up\ '
@@ -23,7 +23,7 @@ tripleo wait_for 30 10 neutron agent-list -f csv -c alive -c agent_type -c host
NET_ID=$(neutron net-list -f csv --quote none | grep default-net | cut -d, -f1)
if ! nova keypair-show default 2>/dev/null; then
tripleo user-config
tripleo user-config
fi
nova boot --poll --key-name default --flavor m1.demo --image user --nic net-id=$NET_ID demo

12
tox.ini
View File

@@ -17,11 +17,13 @@ commands = {posargs}
commands = python setup.py build_sphinx
[testenv:pep8]
whitelist_externals = bash
# We fail pretty horribly on bashate right now
#commands = bash -c "find scripts -type f | xargs bashate -v"
# flake8
commands = flake8
deps = bashate
flake8
whitelist_externals =
bash
commands =
flake8
bash -c "find scripts -type f | xargs bashate -v -iE006"
[flake8]
ignore = H803