Hi,

On my system, when I booted from a 2.6.29 kernel to a 2.6.30 kernel, the
scan order of devices changed, and what was sda became sdc.  This
confused autotest, which then printed out the following error and failed
the job:

ABORT   build   reboot.verify_config    timestamp=1287536803    localtime=Oct 
19 21:06:43       mounted partitions are different after reboot (old entries: 
set([('/dev/sdc3', '/'), ('/dev/sdc1', '/boot'), ('/dev/sdc2', None)]), new 
entries: set([('/dev/sda3', '/'), ('/dev/sda1', '/boot'), ('/dev/sda2', 
None)]))  END ABORT

I modified job.py to check the uuids of the mounted file systems instead
of the devices themselves.  This resolved the issue in my environment.

My python-fu is weak, so I fully expect someone to whip this into better
shape.  On the off-chance that it's mergeable as-is:

Signed-off-by: Jeff Moyer <[email protected]>

diff --git a/client/bin/job.py b/client/bin/job.py
index 6dd19d1..7213f89 100644
--- a/client/bin/job.py
+++ b/client/bin/job.py
@@ -6,7 +6,7 @@ Copyright Andy Whitcroft, Martin J. Bligh 2006
 """
 
 import copy, os, platform, re, shutil, sys, time, traceback, types, glob
-import logging, getpass, errno, weakref
+import logging, getpass, errno, weakref, subprocess
 import cPickle as pickle
 from autotest_lib.client.bin import client_logging_config
 from autotest_lib.client.bin import utils, parallel, kernel, xen
@@ -661,9 +661,20 @@ class base_client_job(base_job.base_job):
             pre-reboot configuration.
         """
         # check to see if any partitions have changed
+        mount_info = set()
         partition_list = partition_lib.get_partition_list(self,
                                                           exclude_swap=False)
-        mount_info = set((p.device, p.get_mountpoint()) for p in 
partition_list)
+        for p in partition_list:
+            try:
+                uuid = subprocess.Popen(['blkid', '-s', 'UUID', '-o', 'value',
+                                         p.device], bufsize=-1,
+                                        stdout=subprocess.PIPE,
+                                        
close_fds=True).communicate()[0].rstrip()
+            except OSError, e:
+                # fall back to using the partition
+                uuid = p.device
+            mount_info.add((uuid, p.get_mountpoint()))
+
         old_mount_info = self._state.get('client', 'mount_info')
         if mount_info != old_mount_info:
             new_entries = mount_info - old_mount_info
@@ -780,9 +791,19 @@ class base_client_job(base_job.base_job):
 
     def reboot_setup(self):
         # save the partition list and mount points, as well as the cpu count
+        mount_info = set()
         partition_list = partition_lib.get_partition_list(self,
                                                           exclude_swap=False)
-        mount_info = set((p.device, p.get_mountpoint()) for p in 
partition_list)
+        for p in partition_list:
+            try:
+                uuid = subprocess.Popen(['blkid', '-s', 'UUID', '-o', 'value',
+                                         p.device], bufsize=-1,
+                                        stdout=subprocess.PIPE,
+                                        
close_fds=True).communicate()[0].rstrip()
+            except OSError, e:
+                # fall back to using the partition
+                uuid = p.device
+            mount_info.add((uuid, p.get_mountpoint()))
         self._state.set('client', 'mount_info', mount_info)
         self._state.set('client', 'cpu_count', utils.count_cpus())
 
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to