[autotest] audio_test_utils: Dump multimedia_xmlrpc_server log

Refactor dump_cros_audio_logs and dump multimedia_xmlrpc_server.log

BUG=chromium:543667
TEST=run audio_AudioBasicUSB* test and check results directory.

Change-Id: Ieeeb103558b2cec8f25b2e68db2783f160fad303
Reviewed-on: https://chromium-review.googlesource.com/306949
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Kalin Stoyanov <kalin@chromium.org>
diff --git a/client/cros/chameleon/audio_test_utils.py b/client/cros/chameleon/audio_test_utils.py
index a88cfed..1bf0ca9 100644
--- a/client/cros/chameleon/audio_test_utils.py
+++ b/client/cros/chameleon/audio_test_utils.py
@@ -12,6 +12,7 @@
 import os
 
 from autotest_lib.client.common_lib import error
+from autotest_lib.client.cros import constants
 
 def check_audio_nodes(audio_facade, audio_nodes):
     """Checks the node selected by Cros device is correct.
@@ -165,13 +166,21 @@
     @directory: The directory to dump logs.
 
     """
-    audio_diagnostics_file_name = (
-            'audio_diagnostics.txt.%s' % suffix
-            if suffix else 'audio_diagnostics.txt')
-    audio_diagnostics_file = os.path.join(
-            directory, audio_diagnostics_file_name)
-    audio_facade.dump_diagnostics(audio_diagnostics_file)
+    def get_file_path(name):
+        """Gets file path to dump logs.
 
-    system_log_file_name = 'messages.%s' % suffix if suffix else 'messages'
-    system_log_file = os.path.join(directory, system_log_file_name)
-    host.get_file('/var/log/messages', system_log_file)
+        @param name: The file name.
+
+        @returns: The file path with an optional suffix.
+
+        """
+        file_name = '%s.%s' % (name, suffix) if suffix else name
+        file_path = os.path.join(directory, file_name)
+        return file_path
+
+    audio_facade.dump_diagnostics(get_file_path('audio_diagnostics.txt'))
+
+    host.get_file('/var/log/messages', get_file_path('messages'))
+
+    host.get_file(constants.MULTIMEDIA_XMLRPC_SERVER_LOG_FILE,
+                  get_file_path('multimedia_xmlrpc_server.log'))