Re: [PATCH xspice 2/2] xspice: add tests for audio remoting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alon,

On 10/20/2013 04:34 PM, Alon Levy wrote:
Signed-off-by: Alon Levy <alevy@xxxxxxxxxx>

diff --git a/tests/xspice_audio_test.py b/tests/xspice_audio_test.py
+def main():
+    port = 8000
+    xspice = launch_xspice(port)
+    sleep(2)
+    client = launch_client(port)
+    sleep(1)
+    produce_audio(xspice.audio_fifo_dir)
+    sleep(2)
+    client.kill()
+    xspice.kill()
+
+if __name__ == '__main__':
+    main()
diff --git a/tests/xspice_util.py b/tests/xspice_util.py
+
+
+def which(prog):
+    for path_element in os.environ['PATH'].split(':'):
+        candidate = os.path.join(path_element, prog)
+        if os.path.exists(candidate):
+            return candidate
+    return None
+
+client_executable = which('remote-viewer')
+if not client_executable:
+    raise SystemExit('missing remote-viewer in path')
+
+def launch_xspice(port):
+    basedir = '/tmp/xspice_test_audio'
+    if not os.path.exists(basedir):
+        os.mkdir(basedir)
+    assert(os.path.exists(basedir))
+    xspice = Process.new(['../scripts/Xspice', '--port', '8000', '--auto', '--audio-fifo-dir', basedir, '--disable-ticketing', ':15.0'])

To make it work for ports other than 8000:

s,'8000','%s' % port,


Regards,
    Uri.

+    xspice.audio_fifo_dir = basedir
+    return xspice
+
+def launch_client(port):
+    client = Process.new([client_executable, 'spice://localhost:%s' % port])
+    return client
+
+if __name__ == '__main__':
+    launch_xspice(port=8000)

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]