Convert gate_hook to devstack-tools
Change-Id: I2387bc9778a77b1673751bc4c1ff50f8d4826a5d
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Sean Dague <sean@dague.net>
Original-Commit: Ibd0f67f9131e7f67f3a4a62cb6ad28bf80e11bbf
(cherry picked from commit e516b8230c)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Ihar Hrachyshka
					
				
			
			
				
	
			
			
			
						parent
						
							aa09d5b260
						
					
				
				
					commit
					658ee769cd
				
			@@ -8,20 +8,34 @@ GATE_DEST=$BASE/new
 | 
			
		||||
NEUTRONCLIENT_PATH=$GATE_DEST/python-neutronclient
 | 
			
		||||
GATE_HOOKS=$NEUTRONCLIENT_PATH/neutronclient/tests/functional/hooks
 | 
			
		||||
DEVSTACK_PATH=$GATE_DEST/devstack
 | 
			
		||||
LOCAL_CONF=$DEVSTACK_PATH/late-local.conf
 | 
			
		||||
DSCONF=/tmp/devstack-tools/bin/dsconf
 | 
			
		||||
 | 
			
		||||
# Install devstack-tools used to produce local.conf; we can't rely on
 | 
			
		||||
# test-requirements.txt because the gate hook is triggered before neutronclient
 | 
			
		||||
# is installed
 | 
			
		||||
sudo -H pip install virtualenv
 | 
			
		||||
virtualenv /tmp/devstack-tools
 | 
			
		||||
/tmp/devstack-tools/bin/pip install -U devstack-tools==0.4.0
 | 
			
		||||
 | 
			
		||||
# Inject config from hook into localrc
 | 
			
		||||
function load_rc_hook {
 | 
			
		||||
    local hook="$1"
 | 
			
		||||
    local tmpfile
 | 
			
		||||
    local config
 | 
			
		||||
    tmpfile=$(tempfile)
 | 
			
		||||
    config=$(cat $GATE_HOOKS/$hook)
 | 
			
		||||
    export DEVSTACK_LOCAL_CONFIG+="
 | 
			
		||||
# generated from hook '$hook'
 | 
			
		||||
${config}
 | 
			
		||||
"
 | 
			
		||||
    echo "[[local|localrc]]" > $tmpfile
 | 
			
		||||
    $DSCONF setlc_raw $tmpfile "$config"
 | 
			
		||||
    $DSCONF merge_lc $LOCAL_CONF $tmpfile
 | 
			
		||||
    rm -f $tmpfile
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if [ "$VENV" == "functional-adv-svcs" ]
 | 
			
		||||
then
 | 
			
		||||
    load_rc_hook fwaas
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
 | 
			
		||||
$BASE/new/devstack-gate/devstack-vm-gate.sh
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user