bug-fix: ipv6 ml2 file should use variable
[yardstick.git] / yardstick / benchmark / scenarios / networking / ping6_pre_setup.bash
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12
13 ML2_CONF_FILE="/etc/neutron/plugins/ml2/ml2_conf.ini"
14 NOVA_CONF_FILE="/etc/nova/nova.conf"
15
16 cp $ML2_CONF_FILE ${ML2_CONF_FILE}_bkp
17
18 agent_line_num=$(grep -n '\[agent\]' $ML2_CONF_FILE | awk -F [:] '{print $1}')
19 if [ -z "$agent_line_num" ]
20 then
21     echo "[agent]" >> $ML2_CONF_FILE
22     agent_line_num=$(wc -l $ML2_CONF_FILE | awk '{print $1}')
23 fi
24 sed -i "${agent_line_num}a prevent_arp_spoofing = False" $ML2_CONF_FILE
25
26 sed -i 's/firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver/firewall_driver= neutron.agent.firewall.NoopFirewallDriver/g' $ML2_CONF_FILE
27
28 #check parameters
29 echo "check if parameters ok"
30 echo $ML2_CONF_FILE
31 grep -n 'enable_security_group = True' $ML2_CONF_FILE
32 grep -n 'extension_drivers = port_security' $ML2_CONF_FILE
33 grep -n 'prevent_arp_spoofing = False' $ML2_CONF_FILE
34 echo $NOVA_CONF_FILE
35 grep -n 'security_group_api = neutron' $NOVA_CONF_FILE
36 grep -n 'firewall_driver = nova.virt.firewall.NoopFirewallDriver' $NOVA_CONF_FILE
37 echo "check parameters end"
38
39 # restart nova and neutron service
40 service neutron-l3-agent restart
41 service neutron-dhcp-agent restart
42 service neutron-metadata-agent restart
43 service neutron-server restart
44 service nova-api restart
45 service nova-cert restart
46 service nova-conductor restart
47 service nova-consoleauth restart
48 service nova-novncproxy restart
49 service nova-scheduler restart
50 service nova-compute restart