mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
systemvm: fix socat usage
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit 888f67f0bdc3e76c452c2dc3f7715f2df12bda7d) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
6ac06e5e5e
commit
0540ba1b30
@ -86,16 +86,16 @@ getpid() {
|
||||
echo $pid
|
||||
}
|
||||
|
||||
stop_socat() {
|
||||
spid=$(pidof socat)
|
||||
[ "$spid" != "" ] && kill -9 $spid && echo "Killed socat (pid=$spid)"
|
||||
stop_password_server() {
|
||||
spid=$(pidof -s python passwd_server_ip.py)
|
||||
[ "$spid" != "" ] && kill -9 $spid && echo "Killed password server (pid=$spid)"
|
||||
return 0
|
||||
}
|
||||
|
||||
stop () {
|
||||
stop_socat
|
||||
stop_password_server
|
||||
pid=$(getpid)
|
||||
[ "$pid" != "" ] && kill -9 $pid && remove_iptables_rules && echo "Stopped password server (pid=$pid)" && stop_socat && return 0
|
||||
[ "$pid" != "" ] && kill -9 $pid && remove_iptables_rules && echo "Stopped password server (pid=$pid)" && stop_password_server && return 0
|
||||
|
||||
echo "Password server is not running" && return 0
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ setup_passwdsvcs() {
|
||||
desetup_passwdsvcs() {
|
||||
logger -t cloud "Desetting up password service for network $ip/$mask, eth $dev "
|
||||
sudo iptables -D INPUT -i $dev -d $ip -p tcp -m state --state NEW --dport 8080 -j ACCEPT
|
||||
pid=`ps -ef | grep socat | grep $ip | grep -v grep | awk '{print $2}'`
|
||||
pid=`ps -ef | grep passwd_server_ip.py | grep $ip | grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$pid" ]
|
||||
then
|
||||
kill -9 $pid
|
||||
|
||||
@ -25,7 +25,7 @@ do
|
||||
rc=$?
|
||||
if [ $rc -ne 0 ]
|
||||
then
|
||||
logger -t cloud "Password server failed with error code $rc. Restarting socat..."
|
||||
logger -t cloud "Password server failed with error code $rc. Restarting password server..."
|
||||
sleep 3
|
||||
fi
|
||||
result=`ip addr show | grep $ip`
|
||||
|
||||
@ -362,7 +362,7 @@ class TestMultipleIpRanges(cloudstackTestCase):
|
||||
def test_03_passwd_service_on_alias_IP(self):
|
||||
"""Deploy guest vm in new CIDR and verify passwd service on alias ip
|
||||
1.Deploy guest vm in new cidr
|
||||
2.Verify password service(socat) listens on alias ip in VR
|
||||
2.Verify password service(passwd_server_ip.py) listens on alias ip in VR
|
||||
"""
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
@ -403,7 +403,7 @@ class TestMultipleIpRanges(cloudstackTestCase):
|
||||
# attempt
|
||||
SshClient(host.ipaddress, port, username, password)
|
||||
|
||||
proc = "socat"
|
||||
proc = "python passwd_server_ip.py"
|
||||
result = get_process_status(
|
||||
host.ipaddress,
|
||||
port,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user