Skip to content

Commit

Permalink
ci: replace static comamnds with grpc calls
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
  • Loading branch information
glimchb committed Aug 10, 2023
1 parent 3a37d72 commit 456f3ef
Showing 1 changed file with 28 additions and 162 deletions.
190 changes: 28 additions & 162 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,93 +54,6 @@ services:
sed -i "s/127.0.0.1/0.0.0.0/g" /etc/frr/daemons && \
ip link add name lo0 type dummy && \
ifconfig lo0 10.0.0.2 netmask 255.255.255.255 up && \
ip link add br-tenant type bridge vlan_default_pvid 0 vlan_filtering 1 vlan_protocol 802.1Q && \
ip link set br-tenant up && \
ip link add blue type vrf table 1000 && \
ip link set blue up && \
ip link add name lo1 type dummy && \
ip link set lo1 master blue up && \
ip address add 10.0.1.2/32 dev lo1 && \
ip link add green type vrf table 1001 && \
ip link set green up && \
ip link add name lo2 type dummy && \
ip link set lo2 master green up && \
ip address add 10.0.2.2/32 dev lo2 && \
ip link add yellow type vrf table 1002 && \
ip link set yellow up && \
ip link add name lo3 type dummy && \
ip link set lo3 master yellow up && \
ip address add 10.0.3.2/32 dev lo3 && \
ip link add br100 addr aa:bb:cc:00:00:02 type bridge && \
ip link set br100 master green up && \
ip link add vni100 type vxlan local 10.0.0.2 dstport 4789 id 100 nolearning && \
ip link set vni100 master br100 up && \
ip link add br101 addr aa:bb:cc:00:00:03 type bridge && \
ip link set br101 master yellow up && \
ip link add vni101 type vxlan local 10.0.0.2 dstport 4789 id 101 nolearning && \
ip link set vni101 master br101 up && \
ip link add vni10 type vxlan id 10 local 10.0.0.2 dstport 4789 nolearning && \
ip link set vni10 master br-tenant up && \
bridge vlan add dev vni10 vid 10 pvid untagged && \
bridge link set dev vni10 neigh_suppress on learning off && \
ip link add vni20 type vxlan id 20 local 10.0.0.2 dstport 4789 nolearning && \
ip link set vni20 master br-tenant up && \
bridge vlan add dev vni20 vid 20 pvid untagged && \
bridge link set dev vni20 neigh_suppress on learning off && \
ip link add vni30 type vxlan id 30 local 10.0.0.2 dstport 4789 nolearning && \
ip link set vni30 master br-tenant up && \
bridge vlan add dev vni30 vid 30 pvid untagged && \
bridge link set dev vni30 neigh_suppress on learning off && \
ip link add vni40 type vxlan id 40 local 10.0.0.2 dstport 4789 nolearning && \
ip link set vni40 master br-tenant up && \
bridge vlan add dev vni40 vid 40 pvid untagged && \
bridge link set dev vni40 neigh_suppress on learning off && \
bridge vlan add dev br-tenant vid 20 self && \
ip link add link br-tenant name vlan20 type vlan id 20 && \
ip link set vlan20 address aa:bb:cc:00:00:21 && \
ip link set vlan20 master blue up && \
ip address add 20.20.20.1/24 dev vlan20 && \
bridge vlan add dev br-tenant vid 30 self && \
ip link add link br-tenant name vlan30 type vlan id 30 && \
ip link set vlan30 address aa:bb:cc:00:00:31 && \
ip link set vlan30 master blue up && \
ip address add 30.30.30.1/24 dev vlan30 && \
bridge vlan add dev br-tenant vid 40 self && \
ip link add link br-tenant name vlan40 type vlan id 40 && \
ip link set vlan40 address aa:bb:cc:00:00:41 && \
ip link set vlan40 master green up && \
ip address add 40.40.40.1/24 dev vlan40 && \
bridge vlan add dev br-tenant vid 50 self && \
ip link add link br-tenant name vlan50 type vlan id 50 && \
ip link set vlan50 address aa:bb:cc:00:00:51 && \
ip link set vlan50 master yellow up && \
ip address add 50.50.50.1/24 dev vlan50 && \
ip link set eth1 up && ip addr flush dev eth1 && \
ip link set eth1 master br-tenant up && \
bridge vlan add dev eth1 vid 10 && \
bridge vlan add dev eth1 vid 20 && \
bridge vlan add dev eth1 vid 40 && \
ip addr flush dev eth2 && ip link set eth2 master br-tenant up && \
bridge vlan add dev eth2 vid 50 && \
/etc/init.d/frr stop && \
/usr/lib/frr/watchfrr -d -F traditional zebra bgpd staticd && \
sleep infinity'
Expand Down Expand Up @@ -334,82 +247,35 @@ services:
ip link add br-tenant type bridge vlan_default_pvid 0 vlan_filtering 1 vlan_protocol 802.1Q && \
ip link set br-tenant up && \
echo create && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf\" : {\"spec\" : {\"vni\" : 100, \"loopback_ip_prefix\": {}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }}, \"vrf_id\" : \"blue\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf\" : {\"spec\" : {\"vni\" : 101, \"loopback_ip_prefix\": {}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }}, \"vrf_id\" : \"green\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf\" : {\"spec\" : {\"vni\" : 102, \"loopback_ip_prefix\": {}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }}, \"vrf_id\" : \"yellow\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge\" : {\"spec\" : {\"vni\" : 11, \"vlan_id\": 11 }}, \"logical_bridge_id\" : \"vxlan11\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge\" : {\"spec\" : {\"vni\" : 22, \"vlan_id\": 22 }}, \"logical_bridge_id\" : \"vxlan22\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge\" : {\"spec\" : {\"vni\" : 33, \"vlan_id\": 33 }}, \"logical_bridge_id\" : \"vxlan33\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateBridgePort "{\"bridge_port\" : {\"spec\" : {\"mac_address\" : \"qrvMAAAB\", \"ptype\": \"ACCESS\", \"logical_bridges\": [] }}, \"bridge_port_id\" : \"eth2\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateBridgePort "{\"bridge_port\" : {\"spec\" : {\"mac_address\" : \"qrvMAAAB\", \"ptype\": \"TRUNK\" , \"logical_bridges\": [] }}, \"bridge_port_id\" : \"eth3\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf_id\" : \"blue\", \"vrf\" : {\"spec\" : {\"vni\" : 0, \"loopback_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf_id\" : \"green\", \"vrf\" : {\"spec\" : {\"vni\" : 101, \"loopback_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateVrf "{\"vrf_id\" : \"yellow\", \"vrf\" : {\"spec\" : {\"vni\" : 102, \"loopback_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24}, \"vtep_ip_prefix\": {\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 167772162}, \"len\": 24} }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge_id\" : \"vni10\", \"logical_bridge\" : {\"spec\" : {\"vni\" : 10, \"vlan_id\": 10 }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge_id\" : \"vni20\", \"logical_bridge\" : {\"spec\" : {\"vni\" : 20, \"vlan_id\": 20 }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge_id\" : \"vni30\", \"logical_bridge\" : {\"spec\" : {\"vni\" : 30, \"vlan_id\": 30 }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge_id\" : \"vni40\", \"logical_bridge\" : {\"spec\" : {\"vni\" : 40, \"vlan_id\": 40 }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateLogicalBridge "{\"logical_bridge_id\" : \"vni50\", \"logical_bridge\" : {\"spec\" : {\"vni\" : 50, \"vlan_id\": 50 }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateSvi "{\"svi_id\" : \"vlan20\", \"svi\" : {\"spec\" : {\"vrf\": \"//network.opiproject.org/vrfs/blue\", \"logical_bridge\": \"//network.opiproject.org/bridges/vni20\", \"mac_address\" : \"qrvMAAAh\", \"gw_ip_prefix\": [{\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 336860161}, \"len\": 24}] }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateSvi "{\"svi_id\" : \"vlan30\", \"svi\" : {\"spec\" : {\"vrf\": \"//network.opiproject.org/vrfs/blue\", \"logical_bridge\": \"//network.opiproject.org/bridges/vni30\", \"mac_address\" : \"qrvMAAAx\", \"gw_ip_prefix\": [{\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 505290241}, \"len\": 24}] }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateSvi "{\"svi_id\" : \"vlan40\", \"svi\" : {\"spec\" : {\"vrf\": \"//network.opiproject.org/vrfs/green\", \"logical_bridge\": \"//network.opiproject.org/bridges/vni40\", \"mac_address\" : \"qrvMAABB\", \"gw_ip_prefix\": [{\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 673720321}, \"len\": 24}] }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateSvi "{\"svi_id\" : \"vlan50\", \"svi\" : {\"spec\" : {\"vrf\": \"//network.opiproject.org/vrfs/yellow\", \"logical_bridge\": \"//network.opiproject.org/bridges/vni50\", \"mac_address\" : \"qrvMAABR\", \"gw_ip_prefix\": [{\"addr\": {\"af\": \"IP_AF_INET\", \"v4_addr\": 842150401}, \"len\": 24}] }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateBridgePort "{\"bridge_port_id\" : \"eth1\", \"bridge_port\" : {\"spec\" : {\"mac_address\" : \"qrvMAAAB\", \"ptype\": \"TRUNK\", \"logical_bridges\": [\"//network.opiproject.org/bridges/vni10\", \"//network.opiproject.org/bridges/vni20\", \"//network.opiproject.org/bridges/vni40\"] }} }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 CreateBridgePort "{\"bridge_port_id\" : \"eth2\", \"bridge_port\" : {\"spec\" : {\"mac_address\" : \"qrvMAAAB\", \"ptype\": \"ACCESS\", \"logical_bridges\": [\"//network.opiproject.org/bridges/vni50\"] }} }" && \
echo get && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/blue\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/green\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/yellow\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vxlan11\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vxlan22\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vxlan33\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetBridgePort "{\"name\" : \"//network.opiproject.org/ports/eth2\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetBridgePort "{\"name\" : \"//network.opiproject.org/ports/eth3\" }" && \
echo toremove && \
ip link add br10 type bridge && \
ip link set br10 addr aa:bb:cc:00:00:11 && \
ip link add link eth1 name eth1.10 type vlan id 10 && \
ip link set eth1 up && ip addr flush dev eth1 && \
ip link set eth1.10 up && \
ip link set eth1.10 master br10 addrgenmode none && \
ip link add vni10 type vxlan local 10.0.0.2 dstport 4789 id 10 nolearning && \
ip link set vni10 master br10 addrgenmode none && \
ip link set vni10 type bridge_slave neigh_suppress on learning off && \
ip link set vni10 up && \
ip link set br10 up && \
ip link add br20 type bridge && \
ip link set br20 master blue addrgenmode none && \
ip link set br20 addr aa:bb:cc:00:00:21 && \
ip link add link eth2 name eth2.20 type vlan id 20 && \
ip link set eth2 up && ip addr flush dev eth2 && \
ip link set eth2.20 up && \
ip link set eth2.20 master br20 addrgenmode none && \
ip addr add 20.20.20.1/24 dev br20 && \
ip link add vni20 type vxlan local 10.0.0.2 dstport 4789 id 20 nolearning && \
ip link set vni20 master br20 addrgenmode none && \
ip link set vni20 type bridge_slave neigh_suppress on learning off && \
ip link set vni20 up && \
ip link set br20 up && \
ip link add br30 type bridge && \
ip link set br30 master blue addrgenmode none && \
ip link set br30 addr aa:bb:cc:00:00:31 && \
ip addr add 30.30.30.1/24 dev br30 && \
ip link add vni30 type vxlan local 10.0.0.2 dstport 4789 id 30 nolearning && \
ip link set vni30 master br30 addrgenmode none && \
ip link set vni30 type bridge_slave neigh_suppress on learning off && \
ip link set vni30 up && \
ip link set br30 up && \
ip link add br40 type bridge && \
ip link set br40 master green addrgenmode none && \
ip link set br40 addr aa:bb:cc:00:00:41 && \
ip link add link eth3 name eth3.40 type vlan id 40 && \
ip link set eth3 up && ip addr flush dev eth3 && \
ip link set eth3.40 up && \
ip link set eth3.40 master br40 addrgenmode none && \
ip addr add 40.40.40.1/24 dev br40 && \
ip link add vni40 type vxlan local 10.0.0.2 dstport 4789 id 40 nolearning && \
ip link set vni40 master br40 addrgenmode none && \
ip link set vni40 type bridge_slave neigh_suppress on learning off && \
ip link set vni40 up && \
ip link set br40 up && \
ip link add br50 type bridge && \
ip link set br50 master yellow addrgenmode none && \
ip link set br50 addr aa:bb:cc:00:00:42 && ip addr flush dev eth4 && \
ip link add link eth4 name eth4.50 type vlan id 50 && \
ip link set eth4.50 up && \
ip link set eth4.50 master br50 addrgenmode none && \
ip addr add 50.50.50.1/24 dev br50 && \
ip link add vni50 type vxlan local 10.0.0.2 dstport 4789 id 50 nolearning && \
ip link set vni50 master br50 addrgenmode none && \
ip link set vni50 type bridge_slave neigh_suppress on learning off && \
ip link set vni50 up && \
ip link set br50 up && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/blue\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/green\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetVrf "{\"name\" : \"//network.opiproject.org/vrfs/yellow\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vni10\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vni20\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vni30\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vni40\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetLogicalBridge "{\"name\" : \"//network.opiproject.org/bridges/vni50\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetSvi "{\"name\" : \"//network.opiproject.org/svis/vlan20\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetSvi "{\"name\" : \"//network.opiproject.org/svis/vlan30\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetSvi "{\"name\" : \"//network.opiproject.org/svis/vlan40\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetSvi "{\"name\" : \"//network.opiproject.org/svis/vlan50\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetBridgePort "{\"name\" : \"//network.opiproject.org/ports/eth1\" }" && \
/entrypoint.sh call --json_input --json_output localhost:50151 GetBridgePort "{\"name\" : \"//network.opiproject.org/ports/eth2\" }" && \
echo done'
host2-leaf2:
Expand Down

0 comments on commit 456f3ef

Please sign in to comment.