Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
dc18dabe
Commit
dc18dabe
authored
Jul 24, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab CI: iperf script changes for checking connectivity
parent
6d504b87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
9 deletions
+51
-9
cmake_targets/autotests/tools/iperf_script
cmake_targets/autotests/tools/iperf_script
+51
-9
No files found.
cmake_targets/autotests/tools/iperf_script
View file @
dc18dabe
...
...
@@ -34,6 +34,8 @@
#arg2 interface
#arg3 iperf arguments
echo
"Start time of script:
`
date
`
"
args
=(
$*
)
timeout
=
${
args
[0]
}
iface
=
${
args
[1]
}
...
...
@@ -48,17 +50,57 @@ echo "iface = $iface"
echo
"iperf_args =
${
iperf_args
[@]
}
"
echo
"ip_client =
$ip_client
"
sleep
$timeout
echo
" Waiting for IP Address..."
while
true
;
do
var
=
`
ifconfig
$iface
`
;
sleep
1
;
if
[
"
$var
"
!=
""
]
;
then
break
;
fi
;
done
;
sleep
5
if
[
-n
"
$ip_client
"
]
;
then
echo
"Waiting for route to be setup before iperf makes connection..."
var
=
`
route
-n
|
grep
$ip_client
`
if
[
"
$var
"
!=
""
]
;
then
break
;
fi
# Test an IP address for validity:
# Usage:
# valid_ip IP_ADDRESS
# if [[ $? -eq 0 ]]; then echo good; else echo bad; fi
# OR
# if valid_ip IP_ADDRESS; then echo good; else echo bad; fi
#
function
valid_ip
()
{
local
ip
=
$1
local stat
=
1
if
[[
$ip
=
~ ^[0-9]
{
1,3
}
\.
[
0-9]
{
1,3
}
\.
[
0-9]
{
1,3
}
\.
[
0-9]
{
1,3
}
$
]]
;
then
OIFS
=
$IFS
IFS
=
'.'
ip
=(
$ip
)
IFS
=
$OIFS
[[
${
ip
[0]
}
-le
255
&&
${
ip
[1]
}
-le
255
\
&&
${
ip
[2]
}
-le
255
&&
${
ip
[3]
}
-le
255
]]
stat
=
$?
fi
return
$stat
}
if
valid_ip
$iface
;
then
echo
"
$iface
is Valid IP Address. Checking for connectivity..."
ping
-c
1
$iface
>
& /dev/null
while
[
"
$?
"
!=
"0"
]
;
do
ping
-c
1
$iface
>
& /dev/null
done
echo
"
$iface
connectivity achieved at
`
date
`
"
else
echo
"Waiting for Interface
$iface
to come up..."
while
true
;
do
var
=
`
ifconfig
$iface
`
;
sleep
1
;
if
[
"
$var
"
!=
""
]
;
then
break
;
fi
;
done
echo
"
$iface
is now available at
`
date
`
"
fi
sleep
5
#if [ -n "$ip_client" ]; then
#echo "Waiting for route to be setup before iperf makes connection..."
# var=`route -n | grep $ip_client`
# if ["$var" != "" ] ; then break; fi
#
#fi
echo
"Sleeping for additional
$timeout
seconds"
sleep
$timeout
echo
"Starting iperf at
`
date
`
...."
iperf
${
iperf_args
[@]
}
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