Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
fa64ce6b
Commit
fa64ce6b
authored
May 31, 2013
by
Dan Reading
Browse files
checkpoint: working for nic and not broken, next add disk serival number checks
parent
18209262
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/nodetest/usr/local/etc/emulab/checkutils.sh
View file @
fa64ce6b
...
...
@@ -123,16 +123,14 @@ comparetmcinfo() {
local
localnics
=
""
tbdbnics
=
""
netunit
=
""
local
-i
a b
local
x addr
# Pull the nics out
# Pull the nics out
and checkthem
#
# if any NICs test - note at this point the same # of NICS are on both lists
set
-x
x
=
${
hwinv
[
"NETINFO"
]
}
a
=
${
x
/NETINFO UNITS=
}
x
=
${
hwinvcopy
[
"NETINFO"
]
}
b
=
${
x
/NETINFO UNITS=
}
[[
$a
>
$b
]]
&&
maxnics
=
$a
||
maxnics
=
$b
set
+x
for
((
i
=
0
;
i<
$maxnics
;
i++
))
;
do
# gather just the nics addresses
netunit
=
"NETUNIT
${
i
}
"
...
...
@@ -153,9 +151,7 @@ set +x
tbdbidx=
${
tbdbidx
/
$netunit
}
fi
done
declare -p localnics
declare -p tbdbnics
set -x
# remove from the lists all matching
# lower case all
localnics=
${
localnics
,,
}
...
...
@@ -168,8 +164,6 @@ set -x
fi
done
# same other swap arrays
echo "
local
|
$localnics
|
"
echo "
tbdb
|
$tbdbnics
|
"
for i in
$tbdbnics
; do
if [ "
${
localnics
/
$i
}
" != "
${
localnics
}
" ]; then
i=
$i
...
...
@@ -181,9 +175,6 @@ echo "tbdb |$tbdbnics|"
read -rd '' localnics <<< "
$localnics
"
read -rd '' tbdbnics <<< "
$tbdbnics
"
echo "
local
|
$localnics
|
"
echo "
tbdb
|
$tbdbnics
|
"
# any mismatches would be in localnics and tbdbnics
[[ -n "
${
localnics
}
" ]] && printf "
%s %s\n
" "
Found
only locally NICs
:
" "
$localnics
"
[[ -n "
${
tbdbnics
}
" ]] && printf "
%s %s\n
" "
In
testbed db but not found NICs
:
" "
$tbdbnics
"
...
...
@@ -191,10 +182,7 @@ echo "tbdb |$tbdbnics|"
arrayidx="
$localidx
$tbdbidx
"
# step through the local index, looking only for one copy
# for i in
${
hwinv
[
"hwinvidx"
]
}
; do
declare -p
${
hwinv
[
"hwinvidx"
]
}
echo "
tbdbidx
|
$tbdbidx
|
"
for i in
${
tbdbidx
}
; do
for i in
${
localidx
}
; do
# following bash syntax: "
${
a
+
$a
}
" says use
$a
if exists else use nothing
if [ -z "
${
hwinvcopy
[
$i
]+
${
hwinvcopy
[
$i
]
}}
" ] ; then
if [ -n "
${
hwinv
[
$i
]+
${
hwinv
[
$i
]
}}
" ] ; then
...
...
@@ -206,10 +194,7 @@ echo "tbdbidx |$tbdbidx|"
done
# step through the testbed index, looking only for one copy
# for i in
${
hwinvcopy
[
"hwinvidx"
]
}
; do
declare -p
${
hwinvcopy
[
"hwinvidx"
]
}
echo "
localidx
|
$localidx
|
"
for i in
${
localidx
}
; do
for i in
${
tbdbidx
}
; do
# followin bash syntax: "
${
a
+
$a
}
" says use
$a
if exists else use nothing
if [ -z "
${
hwinv
[
$i
]+
${
hwinv
[
$i
]
}}
" ] ; then
if [ -n "
${
hwinvcopy
[
$i
]+
${
hwinvcopy
[
$i
]
}}
" ] ; then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment