Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-10-07 08:16:53 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
222880394306e9ad9a33d0e693f8411c33314201
22288039
1 parent
4e969043
Adding ability to push remote bundle updates.
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
cli/src/main/java/org/onlab/onos/cli/net/WipeOutCommand.java
tools/test/bin/onos-patch-vm
tools/test/bin/onos-push-keys
tools/test/bin/onos-push-update-bundle
cli/src/main/java/org/onlab/onos/cli/net/WipeOutCommand.java
View file @
2228803
package
org
.
onlab
.
onos
.
cli
.
net
;
import
org.apache.karaf.shell.commands.Argument
;
import
org.apache.karaf.shell.commands.Command
;
import
org.onlab.onos.net.Device
;
import
org.onlab.onos.net.Host
;
...
...
@@ -18,8 +19,22 @@ import org.onlab.onos.net.intent.IntentState;
description
=
"Wipes-out the entire network information base, i.e. devices, links, hosts"
)
public
class
WipeOutCommand
extends
ClustersListCommand
{
private
static
final
String
DISCLAIMER
=
"Yes, I know it will delete everything!"
;
@Argument
(
index
=
0
,
name
=
"disclaimer"
,
description
=
"Device ID"
,
required
=
true
,
multiValued
=
false
)
String
disclaimer
=
null
;
@Override
protected
void
execute
()
{
if
(!
disclaimer
.
equals
(
DISCLAIMER
))
{
print
(
"I'm afraid I can't do that..."
);
print
(
"You have to acknowledge by: "
+
DISCLAIMER
);
return
;
}
print
(
"Good bye..."
);
DeviceAdminService
deviceAdminService
=
get
(
DeviceAdminService
.
class
);
DeviceService
deviceService
=
get
(
DeviceService
.
class
);
for
(
Device
device
:
deviceService
.
getDevices
())
{
...
...
tools/test/bin/onos-patch-vm
View file @
2228803
...
...
@@ -15,7 +15,7 @@ name=${2:-onos-1}
ssh
$remote
"
sudo perl -pi.bak -e
\"
s/127.0.1.1.*/127.0.1.1
$name
/g
\"
/etc/hosts
sudo
perl -pi.bak -e
\"
local
\$
/ = ''; s/.*/
$name
/g
\"
/etc/hostname
sudo
bash -c
\"
echo
$name
>/etc/hostname
\"
sudo hostname
$name
"
2>/dev/null
...
...
tools/test/bin/onos-push-keys
View file @
2228803
...
...
@@ -9,5 +9,9 @@
remote
=
$ONOS_USER
@
${
1
:-
$OCI
}
scp -q ~/.ssh/id_rsa.pub
$remote
:/tmp
ssh
$remote
"cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys"
ssh
$remote
"
cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
sort -u ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.bak
mv ~/.ssh/authorized_keys.bak ~/.ssh/authorized_keys
"
ssh -n -o
PasswordAuthentication
=
no
$remote
true
...
...
tools/test/bin/onos-push-update-bundle
0 → 100755
View file @
2228803
#!/bin/bash
#-------------------------------------------------------------------------------
# Pushes the specified bundle to the remote ONOS cell machines and updates it.
#-------------------------------------------------------------------------------
[
! -d
"
$ONOS_ROOT
"
]
&&
echo
"ONOS_ROOT is not defined"
>&2
&&
exit
1
.
$ONOS_ROOT
/tools/build/envDefaults
cd
~/.m2/repository
jar
=
$(
find org/onlab -type f -name
'*.jar'
| grep
$1
| grep -v -e -tests | head -n 1
)
[
-z
"
$jar
"
]
&&
echo
"No bundle
$1
found for"
&&
exit
1
bundle
=
$(
echo
$(
basename
$jar
.jar
)
| sed
's/-[0-9].*//g'
)
nodes
=
$(
env | sort | egrep
"OC[0-9]+"
| cut -d
=
-f2
)
for
node
in
$nodes
;
do
scp
$jar
$ONOS_USER
@
$node
:
$ONOS_INSTALL_DIR
/
$KARAF_DIST
/system/
$jar
ssh
$ONOS_USER
@
$node
$ONOS_INSTALL_DIR
/bin/onos update
$bundle
done
Please
register
or
login
to post a comment