deleted file mode 100755
@@ -1,37 +0,0 @@
-#!/usr/bin/python
-import socket, struct, os, signal, sys
-# -*- coding: utf-8 -*-
-
-"""
-Script used to join machine into multicast groups.
-
-@author Amos Kong <akong@redhat.com>
-"""
-
-if __name__ == "__main__":
- if len(sys.argv) < 4:
- print """%s [mgroup_count] [prefix] [suffix]
- mgroup_count: count of multicast addresses
- prefix: multicast address prefix
- suffix: multicast address suffix""" % sys.argv[0]
- sys.exit()
-
- mgroup_count = int(sys.argv[1])
- prefix = sys.argv[2]
- suffix = int(sys.argv[3])
-
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- for i in range(mgroup_count):
- mcast = prefix + "." + str(suffix + i)
- try:
- mreq = struct.pack("4sl", socket.inet_aton(mcast),
- socket.INADDR_ANY)
- s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
- except:
- s.close()
- print "Could not join multicast: %s" % mcast
- raise
-
- print "join_mcast_pid:%s" % os.getpid()
- os.kill(os.getpid(), signal.SIGSTOP)
- s.close()
new file mode 100755
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+import socket, struct, os, signal, sys
+# -*- coding: utf-8 -*-
+
+"""
+Script used to join machine into multicast groups.
+
+@author Amos Kong <akong@redhat.com>
+"""
+
+if __name__ == "__main__":
+ if len(sys.argv) < 4:
+ print """%s [mgroup_count] [prefix] [suffix]
+ mgroup_count: count of multicast addresses
+ prefix: multicast address prefix
+ suffix: multicast address suffix""" % sys.argv[0]
+ sys.exit()
+
+ mgroup_count = int(sys.argv[1])
+ prefix = sys.argv[2]
+ suffix = int(sys.argv[3])
+
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ for i in range(mgroup_count):
+ mcast = prefix + "." + str(suffix + i)
+ try:
+ mreq = struct.pack("4sl", socket.inet_aton(mcast),
+ socket.INADDR_ANY)
+ s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
+ except:
+ s.close()
+ print "Could not join multicast: %s" % mcast
+ raise
+
+ print "join_mcast_pid:%s" % os.getpid()
+ os.kill(os.getpid(), signal.SIGSTOP)
+ s.close()
@@ -53,9 +53,9 @@ def run_multicast(test, params, env):
prefix = re.findall("\d+.\d+.\d+", mcast)[0]
suffix = int(re.findall("\d+", mcast)[-1])
# copy python script to guest for joining guest to multicast groups
- mcast_path = os.path.join(test.bindir, "scripts/join_mcast.py")
+ mcast_path = os.path.join(test.bindir, "scripts/multicast_guest.py")
vm.copy_files_to(mcast_path, "/tmp")
- output = session.cmd_output("python /tmp/join_mcast.py %d %s %d" %
+ output = session.cmd_output("python /tmp/multicast_guest.py %d %s %d" %
(mgroup_count, prefix, suffix))
# if success to join multicast, the process will be paused, and return PID.