diff options
author | CNlucius <lukai1@huawei.com> | 2016-09-13 11:40:12 +0800 |
---|---|---|
committer | CNlucius <lukai1@huawei.com> | 2016-09-13 11:41:53 +0800 |
commit | b731e2f1dd0972409b136aebc7b463dd72c9cfad (patch) | |
tree | 5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/tools/package/bin | |
parent | ee93993458266114c29271a481ef9ce7ce621b2a (diff) |
ONOSFW-171
O/S-SFC-ONOS scenario documentation
Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365
Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/tools/package/bin')
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-client | 17 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-config | 2 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-form-cluster | 39 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-jpenable | 7 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-secure-ssh | 38 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-service | 44 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-ssh | 6 | ||||
-rwxr-xr-x | framework/src/onos/tools/package/bin/onos-user-key | 20 |
8 files changed, 0 insertions, 173 deletions
diff --git a/framework/src/onos/tools/package/bin/onos-client b/framework/src/onos/tools/package/bin/onos-client deleted file mode 100755 index 2a37087a..00000000 --- a/framework/src/onos/tools/package/bin/onos-client +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# ONOS command-line client that uses the built-in Apache Karaf client. -# ----------------------------------------------------------------------------- - -if [ -z "${JAVA_HOME}" ]; then - if [ -x /usr/libexec/java_home ]; then - export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) - elif [ -d /usr/lib/jvm/java-8-oracle ]; then - export JAVA_HOME="/usr/lib/jvm/java-8-oracle" - elif [ -d /usr/lib/jvm/java-7-openjdk-amd64 ]; then - export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" - fi -fi - -cd $(dirname $0)/../apache-karaf-$KARAF_VERSION/bin -./client -h localhost -u karaf "$@" diff --git a/framework/src/onos/tools/package/bin/onos-config b/framework/src/onos/tools/package/bin/onos-config deleted file mode 100755 index 2265d002..00000000 --- a/framework/src/onos/tools/package/bin/onos-config +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo "This command has been deprecated as this step is no longer required."
\ No newline at end of file diff --git a/framework/src/onos/tools/package/bin/onos-form-cluster b/framework/src/onos/tools/package/bin/onos-form-cluster deleted file mode 100755 index 7a0abda6..00000000 --- a/framework/src/onos/tools/package/bin/onos-form-cluster +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# Forms ONOS cluster using REST API of each separate instance. -# ----------------------------------------------------------------------------- - -[ $# -lt 2 ] && echo "usage: $(basename $0) ip1 ip2..." && exit 1 - -# Scan arguments for user/password or other options... -while getopts u:p: o; do - case "$o" in - u) user=$OPTARG;; - p) password=$OPTARG;; - esac -done -user=${user:-onos} # user defaults to 'onos' -password=${password:-$user} # password defaults to user name if not specified -let OPC=$OPTIND-1 -shift $OPC - -ip=$1 -shift -nodes=$* - -ipPrefix=${ip%.*} - -aux=/tmp/${ipPrefix}.cluster.json -trap "rm -f $aux" EXIT - -echo "{ \"nodes\": [ { \"ip\": \"$ip\" }" > $aux -for node in $nodes; do - echo ", { \"ip\": \"$node\" }" >> $aux -done -echo "], \"ipPrefix\": \"$ipPrefix.*\" }" >> $aux - -for node in $ip $nodes; do - echo "Forming cluster on $node..." - curl --user $user:$password -X POST \ - http://$node:8181/onos/v1/cluster/configuration -d @$aux -done
\ No newline at end of file diff --git a/framework/src/onos/tools/package/bin/onos-jpenable b/framework/src/onos/tools/package/bin/onos-jpenable deleted file mode 100755 index 7c69602a..00000000 --- a/framework/src/onos/tools/package/bin/onos-jpenable +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -kpid=$(ps -ef | grep karaf.main.Main | grep -v grep | cut -c10-15 | tr -d ' ') - -[ -z "$kpid" ] && echo "No ONOS!" && exit 1 - -/opt/jprofiler8/bin/jpenable --gui --port=8849 --pid=$kpid diff --git a/framework/src/onos/tools/package/bin/onos-secure-ssh b/framework/src/onos/tools/package/bin/onos-secure-ssh deleted file mode 100755 index 3f541dbe..00000000 --- a/framework/src/onos/tools/package/bin/onos-secure-ssh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# Enables secure access to ONOS console by removing default users & keys. -# ----------------------------------------------------------------------------- - -rm -f $(dirname $0)/onos - -set -e - -# Scan arguments for user/password or other options... -while getopts u:p: o; do - case "$o" in - u) user=$OPTARG;; - p) password=$OPTARG;; - esac -done -password=${password:-$user} # password defaults to the user if not specified -let OPC=$OPTIND-1 -shift $OPC - -cd $(dirname $0)/../apache-karaf-*/etc -USERS=users.properties -KEYS=keys.properties - -# Remove the built-in users and keys to secure the access implicitly. -egrep -v "^(karaf|onos)[ ]*=" $USERS > $USERS.new && mv $USERS.new $USERS -egrep -v "^(#karaf|onos)[ ]*=" $KEYS > $KEYS.new && mv $KEYS.new $KEYS - -# Remove any previous known keys for the local host. -ssh-keygen -f "$HOME/.ssh/known_hosts" -R [localhost]:8101 - -# Swap the onos client to use the SSH variant. -ln -s $(dirname $0)/onos-ssh $(dirname $0)/onos - -# If user and password options were given, setup the user/password. -if [ -n "$user" -a -n "$password" ]; then - echo "$user = $password,_g_:admingroup" >> $USERS -fi
\ No newline at end of file diff --git a/framework/src/onos/tools/package/bin/onos-service b/framework/src/onos/tools/package/bin/onos-service deleted file mode 100755 index 2f00ca02..00000000 --- a/framework/src/onos/tools/package/bin/onos-service +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# Starts ONOS Apache Karaf container -# ----------------------------------------------------------------------------- - -# uncomment the following line for performance testing -#export JAVA_OPTS="${JAVA_OPTS:--Xms8G -Xmx8G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps}" - -# uncomment the following line for Netty TLS encryption -# Do modify the keystore location/password and truststore location/password accordingly -#export JAVA_OPTS="${JAVA_OPTS:--DenableNettyTLS=true -Djavax.net.ssl.keyStore=/home/ubuntu/onos.jks -Djavax.net.ssl.keyStorePassword=222222 -Djavax.net.ssl.trustStore=/home/ubuntu/onos.jks -Djavax.net.ssl.trustStorePassword=222222}" - -ONOS_HOME=/opt/onos -KARAF_ARGS= -SYS_APPS=drivers - -[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/.. - -# Parse out arguments destinted for karaf invocation v. arguments that -# will be processed in line -while [ $# -gt 0 ]; do - case $1 in - apps-clean) - # Deactivate all applications - find ${ONOS_HOME}/apps -name "active" -exec rm \{\} \; - ;; - *) - KARAF_ARGS+=" $1" - ;; - esac - shift -done - -# Activate the system required applications (SYS_APPS) as well as any -# specified applications in the var ONOS_APPS -for app in ${SYS_APPS//,/ } ${ONOS_APPS//,/ }; do - if [[ "$app" =~ \. ]]; then - touch ${ONOS_HOME}/apps/$app/active - else - touch ${ONOS_HOME}/apps/org.onosproject.$app/active - fi -done - -exec ${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf $KARAF_ARGS diff --git a/framework/src/onos/tools/package/bin/onos-ssh b/framework/src/onos/tools/package/bin/onos-ssh deleted file mode 100755 index 7e082aa5..00000000 --- a/framework/src/onos/tools/package/bin/onos-ssh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# ONOS command-line client that uses raw ssh. -# ----------------------------------------------------------------------------- - -ssh -p 8101 localhost "$@"
\ No newline at end of file diff --git a/framework/src/onos/tools/package/bin/onos-user-key b/framework/src/onos/tools/package/bin/onos-user-key deleted file mode 100755 index db24da17..00000000 --- a/framework/src/onos/tools/package/bin/onos-user-key +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# ----------------------------------------------------------------------------- -# Adds or removes a user key for managing passwordless loging to ONOS console. -# ----------------------------------------------------------------------------- - -[ $# -lt 2 ] && echo "usage: $(basename $0) user {key|remove}" && exit 1 - -set -e - -user=$1 -[ -f $2 ] && key=$(cut -d\ -f2 $2) || key=$2 - -cd $(dirname $0)/../apache-karaf-*/etc -KEYS=keys.properties - -# Remove the user key first, in case one was already present -egrep -v "^$user[ ]*=" $KEYS > $KEYS.new && mv $KEYS.new $KEYS -if [ $key != "remove" ]; then - echo "$user=$key,_g_:admingroup" >> $KEYS -fi |