summaryrefslogtreecommitdiffstats
path: root/tests/ci/prepare_env.sh
diff options
context:
space:
mode:
authorDimitrios Markou <mardim@intracom-telecom.com>2018-03-21 16:09:58 +0200
committerDimitrios Markou <mardim@intracom-telecom.com>2018-05-08 12:53:14 +0300
commite00ef072b2c0499061f3e375cbff0bc3f47fb35b (patch)
treebbac4892a1ba320f7f50ff496bb708dea8b2a3bf /tests/ci/prepare_env.sh
parenta4c8f2a99f56dd4c9fbac4021706aa9186d23ed8 (diff)
Add pod.yaml files for Apex
JIRA: YARDSTICK-1097 Change-Id: If116174c562bc08c0b7602324599bc85d8c60be0 Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com> (cherry picked from commit 6f374141466640655cc57277b4b49d6deffa9092)
Diffstat (limited to 'tests/ci/prepare_env.sh')
-rwxr-xr-xtests/ci/prepare_env.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh
index d7c60d48f..8b9f887b2 100755
--- a/tests/ci/prepare_env.sh
+++ b/tests/ci/prepare_env.sh
@@ -16,6 +16,7 @@
: ${EXTERNAL_NETWORK:='admin_floating_net'}
: ${USER_NAME:='ubuntu'}
: ${SSH_KEY:='/root/.ssh/id_rsa'}
+: ${DEPLOY_SCENARIO:='unknown'}
# Extract network name from EXTERNAL_NETWORK
# e.g. EXTERNAL_NETWORK='ext-net;flat;192.168.0.2;192.168.0.253;192.168.0.1;192.168.0.0/24'
@@ -62,7 +63,73 @@ verify_connectivity() {
}
ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+if [ "$INSTALLER_TYPE" == "apex" ]; then
+ # check the connection
+ verify_connectivity "${INSTALLER_IP}"
+
+ pod_yaml="$YARDSTICK_REPO_DIR/etc/yardstick/nodes/apex_baremetal/pod.yaml"
+
+ # update "ip" according to the CI env
+ ssh -l root "${INSTALLER_IP}" -i ${SSH_KEY} ${ssh_options} \
+ "source /home/stack/stackrc && openstack server list -f yaml" > node_info
+
+ controller_ips=($(awk '/control/{getline; {print $2}}' < node_info | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'))
+ compute_ips=($(awk '/compute/{getline; {print $2}}' < node_info | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'))
+ odl_ip=""
+ # Get ODL's cluster default module-shard Leader IP in HA scenario
+ if [[ ${DEPLOY_SCENARIO} == os-odl-*-ha ]]; then
+ for ip in "${controller_ips[@]}";
+ do
+ if [[ "$odl_ip" ]]; then
+ break
+ fi
+ for ((i=0; i<${#controller_ips[@]}; i++));
+ do
+ ODL_STATE=$(curl -s -u admin:admin -H "Accept: application/json" -H "Content-Type: application/json" \
+ "http://"${ip}":8081/jolokia/read/org.opendaylight.controller:Category=Shards,name=member-"${i}"-shard-default-operational,type=DistributedOperationalDatastore" \
+ | grep -o \"RaftState\"\:\"Leader\" | tr ":" "\n" | sed -n '2p' | sed 's/\"//g');
+
+ if [[ ${ODL_STATE} == "Leader" ]]; then
+ odl_ip=${ip}
+ break
+ fi
+ done;
+ done
+
+ if [[ -z "$odl_ip" ]]; then
+ echo "ERROR: Opendaylight Leader IP is emtpy"
+ exit 1
+ fi
+
+ elif [[ ${DEPLOY_SCENARIO} == *"odl"* ]]; then
+ odl_ip=${controller_ips[0]}
+ fi
+
+ if [[ ${controller_ips[0]} ]]; then
+ sed -i "s|ip1|${controller_ips[0]}|" "${pod_yaml}"
+ fi
+ if [[ ${controller_ips[1]} ]]; then
+ sed -i "s|ip2|${controller_ips[1]}|" "${pod_yaml}"
+ fi
+ if [[ ${controller_ips[2]} ]]; then
+ sed -i "s|ip3|${controller_ips[2]}|" "${pod_yaml}"
+ fi
+ if [[ ${compute_ips[0]} ]]; then
+ sed -i "s|ip4|${compute_ips[0]}|" "${pod_yaml}"
+ fi
+ if [[ ${compute_ips[1]} ]]; then
+ sed -i "s|ip5|${compute_ips[1]}|" "${pod_yaml}"
+ fi
+ if [[ ${odl_ip} ]]; then
+ sed -i "s|ip6|${odl_ip}|" "${pod_yaml}"
+ fi
+
+
+ # update 'key_filename' according to the CI env
+ sed -i "s|node_keyfile|${SSH_KEY}|" "${pod_yaml}"
+
+fi
if [ "$INSTALLER_TYPE" == "fuel" ]; then
# check the connection
.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright 2010 Ben. Herrenschmidt, IBM Corporation.
 *
 * Based on earlier code:
 *   Copyright (C) Paul Mackerras 1997.
 *
 *   Matt Porter <mporter@kernel.crashing.org>
 *   Copyright 2002-2005 MontaVista Software Inc.
 *
 *   Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
 *   Copyright (c) 2003, 2004 Zultys Technologies
 *
 *    Copyright 2007 David Gibson, IBM Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */
#include <stdarg.h>
#include <stddef.h>
#include "types.h"
#include "elf.h"
#include "string.h"
#include "stdio.h"
#include "page.h"
#include "ops.h"
#include "reg.h"
#include "io.h"
#include "dcr.h"
#include "4xx.h"
#include "44x.h"
#include "libfdt.h"

BSS_STACK(4096);

static u32 ibm4xx_memstart;

static void iss_4xx_fixups(void)
{
	void *memory;
	u32 reg[3];

	memory = finddevice("/memory");
	if (!memory)
		fatal("Can't find memory node\n");
	/* This assumes #address-cells = 2, #size-cells =1 and that */
	getprop(memory, "reg", reg, sizeof(reg));
	if (reg[2])
		/* If the device tree specifies the memory range, use it */
		ibm4xx_memstart = reg[1];
	else
		/* othersize, read it from the SDRAM controller */
		ibm4xx_sdram_fixup_memsize();
}

static void *iss_4xx_vmlinux_alloc(unsigned long size)
{
	return (void *)ibm4xx_memstart;
}

#define SPRN_PIR	0x11E	/* Processor Indentification Register */
void platform_init(void)
{
	unsigned long end_of_ram = 0x08000000;
	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
	u32 pir_reg;

	simple_alloc_init(_end, avail_ram, 128, 64);
	platform_ops.fixups = iss_4xx_fixups;
	platform_ops.vmlinux_alloc = iss_4xx_vmlinux_alloc;
	platform_ops.exit = ibm44x_dbcr_reset;
	pir_reg = mfspr(SPRN_PIR);
	fdt_set_boot_cpuid_phys(_dtb_start, pir_reg);
	fdt_init(_dtb_start);
	serial_console_init();
}