Multiple machines job results can't be parsed correctly due to missing
keyval.
Run a simple multiple machine job like this.

    #./server/autoserv ./server/samples/sleeptest.srv -r results -m
gpfsa1,gpfsa2
    #cd results
    #find . -name "keyval"
    ./gpfsa2/sleeptest/keyval
    ./gpfsa1/sleeptest/keyval
    ./keyval

No keyval file found under machine-level result directory. So that
status_version will be regarded as 0 by default. Thus, some format version 1
log will be wrongly intepreted. Given the following example log, no Failure
reason won't resported in Email.


    START  ----    ----    timestamp=1236446901    localtime=Mar 07 09:28:21
           START   sleeptest       sleeptest       timestamp=1236446901
localtime=Mar 07 09:28:21

                   FAIL   sleeptest       sleeptest
timestamp=1236446902    localtime=Mar 07 09:28:22       Command <ls
/nonexisted> failed, rc=2, Command returned non-zero exit status
                     * Command:
                         ls /nonexisted
                     Exit status: 2
                     Duration: 0
                     stderr:
                     ls: 0653-341 The file /nonexisted does not exist.
           END FAIL       sleeptest       sleeptest
timestamp=1236446902    localtime=Mar 07 09:28:22
    END GOOD       ----    ----    timestamp=1236446909    localtime=Mar 07
09:28:29


    #./tko/parse ./results -m

    Job name     Kernel   Test name  FAIL/WARN   Failure reason
    =========    ======   =========  =========   ==============
    temp/gpfsa2           gpfsa2     FAIL
    temp/gpfsa1           gpfsa1     FAIL

- Possible fix
According to parser spec at
http://autotest.kernel.org/wiki/DraftParserSpecification,  One keyval
file is desired for each machine result directory. Also, status_version
should be set as 1 to indicate the real log format version. I tried to
figure out a patch. Please review.

From: simon.x.zheng@gmail.com



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2867 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index b32572f..374937e 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -345,6 +345,9 @@
             def wrapper(machine):
                 self.resultdir = os.path.join(self.resultdir, machine)
                 os.chdir(self.resultdir)
+                machine_data = {'hostname' : machine,
+                                'status_version' : str(self.STATUS_VERSION)}
+                utils.write_keyval(self.resultdir, machine_data)
                 result = function(machine)
                 return result
         else: