New server test to check whether the kernel ignores the "gpt" option.

BUG=chromium:260040
TEST=Tested by running on my Pixel device.

Change-Id: Id62bd1f08c0e774b294f0dfb09ccdbd66f16ca47
Reviewed-on: https://chromium-review.googlesource.com/66114
Tested-by: Siva Reddy <sivachandra@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Siva Reddy <sivachandra@chromium.org>
diff --git a/server/site_tests/kernel_IgnoreGptOptionServer/control b/server/site_tests/kernel_IgnoreGptOptionServer/control
new file mode 100644
index 0000000..c10890f
--- /dev/null
+++ b/server/site_tests/kernel_IgnoreGptOptionServer/control
@@ -0,0 +1,20 @@
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+NAME = 'kernel_IgnoreGptOptionServer'
+AUTHOR = 'The Chromium OS Authors'
+PURPOSE = 'Test that the kernel ignores the "gpt" cmd line option.'
+TIME = 'SHORT'
+TEST_CLASS = 'kernel'
+TEST_TYPE = 'server'
+
+DOC = '''
+    Checks that kernel is ignoring the command line option "gpt".
+'''
+
+def run(machine):
+    host = hosts.create_host(machine)
+    job.run_test("kernel_IgnoreGptOptionServer", host=host)
+
+parallel_simple(run, machines)
diff --git a/server/site_tests/kernel_IgnoreGptOptionServer/kernel_IgnoreGptOptionServer.py b/server/site_tests/kernel_IgnoreGptOptionServer/kernel_IgnoreGptOptionServer.py
new file mode 100644
index 0000000..6745f1e
--- /dev/null
+++ b/server/site_tests/kernel_IgnoreGptOptionServer/kernel_IgnoreGptOptionServer.py
@@ -0,0 +1,29 @@
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from autotest_lib.client.common_lib import error
+from autotest_lib.server import test
+
+class kernel_IgnoreGptOptionServer(test.test):
+    """Test to check that the kernel is ignoring the cmd line option 'gpt'.
+    """
+    version = 1
+
+
+    def run_once(self, host=None):
+        # Check if gpt option is present on the command line.
+        try:
+            host.run('cat /proc/cmdline | grep -E "( gpt)|(gpt )"')
+        except error.AutoservRunError:
+            raise error.TestNAError('No need to check that "gpt" is ignored '
+                                    'by the kernel on this device.')
+
+        # Reboot the client
+        host.reboot()
+
+        try:
+            msg = 'Not forcing GPT even though \'gpt\' specified on cmd line.'
+            host.run ('dmesg | grep "%s"' % msg)
+        except error.AutoservRunError:
+            raise error.TestFail('The option "gpt" not ignored by the kernel.')