7048407 Additional 47 install_unit_tests failures after CUD AI putback.
authorMatt Keenan <matt.keenan@oracle.com>
Fri, 27 May 2011 09:34:25 +0100
changeset 1154 8cb36a37e75d
parent 1153 cdfbbe758b36
child 1155 4eb6bb7bb4a0
7048407 Additional 47 install_unit_tests failures after CUD AI putback.
usr/src/cmd/auto-install/README.test
usr/src/cmd/auto-install/auto_install.py
usr/src/cmd/auto-install/checkpoints/dmm.py
usr/src/cmd/auto-install/checkpoints/test/test_auto_install_script.py
usr/src/cmd/auto-install/checkpoints/test/test_python_script
usr/src/cmd/auto-install/checkpoints/test/test_shell_script.sh
usr/src/cmd/auto-install/test/test_auto_install_script.py
usr/src/cmd/auto-install/test/test_python_script
usr/src/cmd/auto-install/test/test_shell_script.sh
usr/src/lib/install_manifest_input/test/test_manifest_input_overlay.py
usr/src/lib/install_manifest_input/test/test_manifest_input_pathing.py
usr/src/lib/install_manifest_input/test/test_manifest_input_validate_commit.py
usr/src/tools/tests/tests.nose
--- a/usr/src/cmd/auto-install/README.test	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/cmd/auto-install/README.test	Fri May 27 09:34:25 2011 +0100
@@ -137,3 +137,15 @@
 $ ai_sd -n <service_name> -o <service_list> -d 1-4
 
 where '-d 4' enables the most verbose mode
+
+AI Derived Manifest Moduile Testing
+===================================
+dmm testing is not performed automatically and must be done manually
+as they require a user 'aiuser' to be added to the system.
+
+The tests can be run manually by :
+ - Ensure userid 'aiuser' exists on the machine
+ - As root ensure bldenv script is run.
+ - Run each test manually e.g.
+   $ cd $SRC/cmd/auto-install/checkpoints/test
+   $ python ./dmm_build_test.py
--- a/usr/src/cmd/auto-install/auto_install.py	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/cmd/auto-install/auto_install.py	Fri May 27 09:34:25 2011 +0100
@@ -85,10 +85,10 @@
     TARGET_INSTANTIATION_CHECKPOINT = 'target-instantiation'
     FIRST_TRANSFER_CHECKPOINT = 'first-transfer'
     MANIFEST_CHECKPOINTS = ["derived-manifest", "manifest-parser"]
-    CHECKPOINTS_BEFORE_IPS = ["target-discovery", TARGET_INSTANTIATION_CHECKPOINT]
-    CHECKPOINTS_BEFORE_IPS.extend(MANIFEST_CHECKPOINTS)
-    CHECKPOINTS_BEFORE_TI = ["target-discovery", TARGET_INSTANTIATION_CHECKPOINT]
+    CHECKPOINTS_BEFORE_TI = ["target-discovery", "target-selection",
+                             TARGET_INSTANTIATION_CHECKPOINT]
     CHECKPOINTS_BEFORE_TI.extend(MANIFEST_CHECKPOINTS)
+    CHECKPOINTS_BEFORE_IPS = list(CHECKPOINTS_BEFORE_TI)
     TRANSFER_FILES_CHECKPOINT = 'transfer-ai-files'
     INSTALLED_ROOT_DIR = "/a"
 
--- a/usr/src/cmd/auto-install/checkpoints/dmm.py	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/cmd/auto-install/checkpoints/dmm.py	Fri May 27 09:34:25 2011 +0100
@@ -447,7 +447,7 @@
         self.logger.info(MSG_HEADER +
                          "Script validated.  Running in subprocess...")
 
-        cmdlist = [SU, AIUSER_ACCOUNT_NAME, script_name]
+        cmdlist = [SU, AIUSER_ACCOUNT_NAME, "-c", script_name]
         subproc = Popen(cmdlist, stderr=Popen.STDOUT, stdout=Popen.PIPE,
                         preexec_fn=self.subproc_env_setup)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/auto-install/checkpoints/test/test_auto_install_script.py	Fri May 27 09:34:25 2011 +0100
@@ -0,0 +1,98 @@
+#!/usr/bin/python
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+'''
+Tests auto install with script which derives the manifest to be used
+'''
+
+import os
+import unittest
+
+from solaris_install.auto_install import auto_install
+from solaris_install.engine.test.engine_test_utils import reset_engine
+
+
+class TestAutoInstallScript(unittest.TestCase):
+    '''Tests to auto installation succeeds with -m specified derived script '''
+
+    AI = None
+
+    def setUp(self):
+        '''
+        Create a auto_install client for testing with.
+        '''
+        self.AI = None
+
+    def tearDown(self):
+        '''
+        Clean Up
+        '''
+        if self.AI is not None:
+            # Reset the Engine for next test
+            if self.AI.engine is not None:
+                reset_engine(self.AI.engine)
+
+            # Remove install log as test has succeeded
+            if os.path.isfile(self.AI.INSTALL_LOG):
+                os.remove(self.AI.INSTALL_LOG)
+
+    def test_shell_script(self):
+        '''
+        Test installation with derived manifest shell script
+        '''
+        # To run tests bldenv script will have been run, thus we can assume
+        # that $SRC environment variable will be set.
+        testscript = os.environ['SRC'] +  \
+            "/cmd/auto-install/checkpoints/test/test_shell_script.sh"
+        args = ["-n", "-s", "target-discovery", "-m", testscript]
+
+        try:
+            self.AI = auto_install.AutoInstall(args)
+            self.assertNotEqual(self.AI, None)
+            self.AI.perform_autoinstall()
+            self.assertNotEqual(self.AI.exitval, self.AI.AI_EXIT_FAILURE)
+        except KeyboardInterrupt:
+            pass
+
+    def test_python_script(self):
+        '''
+        Test installation with derived manifest python script
+        '''
+        # To run tests bldenv script will have been run, thus we can assume
+        # that $SRC environment variable will be set.
+        testscript = os.environ['SRC'] +  \
+            "/cmd/auto-install/checkpoints/test/test_python_script.py"
+        args = ["-n", "-s", "target-discovery", "-m", testscript]
+
+        try:
+            self.AI = auto_install.AutoInstall(args)
+            self.assertNotEqual(self.AI, None)
+            self.AI.perform_autoinstall()
+            self.assertNotEqual(self.AI.exitval, self.AI.AI_EXIT_FAILURE)
+        except KeyboardInterrupt:
+            pass
+
+if __name__ == '__main__':
+    unittest.main()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/auto-install/checkpoints/test/test_python_script	Fri May 27 09:34:25 2011 +0100
@@ -0,0 +1,8 @@
+#!/bin/python
+
+import os
+import sys
+
+sys_str = "pfexec cp -f " + os.environ['SRC'] + "/cmd/auto-install/test/manifest_auto_reboot_true.xml /var/run/manifest.xml"
+ret = os.system(sys_str)
+sys.exit(ret)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/auto-install/checkpoints/test/test_shell_script.sh	Fri May 27 09:34:25 2011 +0100
@@ -0,0 +1,5 @@
+#!/bin/ksh93
+
+pfexec cp -f ${SRC}/cmd/auto-install/test/manifest_auto_reboot_true.xml /var/run/manifest.xml
+
+exit $?
--- a/usr/src/cmd/auto-install/test/test_auto_install_script.py	Thu May 26 12:41:48 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-#!/usr/bin/python
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-#
-'''
-Tests auto install with script which derives the manifest to be used
-'''
-
-import os
-import unittest
-
-from solaris_install.auto_install import auto_install
-from solaris_install.engine.test.engine_test_utils import reset_engine
-
-
-class TestAutoInstallScript(unittest.TestCase):
-    '''Tests to auto installation succeeds with -m specified derived script '''
-
-    AI = None
-
-    def setUp(self):
-        '''
-        Create a auto_install client for testing with.
-        '''
-        self.AI = None
-
-    def tearDown(self):
-        '''
-        Clean Up
-        '''
-        if self.AI is not None:
-            # Reset the Engine for next test
-            if self.AI.engine is not None:
-                reset_engine(self.AI.engine)
-
-            # Remove install log as test has succeeded
-            if os.path.isfile(self.AI.INSTALL_LOG):
-                os.remove(self.AI.INSTALL_LOG)
-
-    def test_shell_script(self):
-        '''
-        Test installation with derived manifest shell script
-        '''
-        # To run tests bldenv script will have been run, thus we can assume
-        # that $SRC environment variable will be set.
-        testscript = os.environ['SRC'] +  \
-            "/cmd/auto-install/test/test_shell_script.sh"
-        args = ["-n", "-m", testscript]
-
-        # TODO, write the testscript.sh
-
-        try:
-            self.AI = auto_install.AutoInstall(args)
-            self.assertNotEqual(self.AI, None)
-            self.AI.perform_autoinstall()
-            self.assertNotEqual(self.AI.exitval, self.AI.AI_EXIT_FAILURE)
-        except KeyboardInterrupt:
-            pass
-
-    def test_python_script(self):
-        '''
-        Test installation with derived manifest python script
-        '''
-        # To run tests bldenv script will have been run, thus we can assume
-        # that $SRC environment variable will be set.
-        testscript = os.environ['SRC'] +  \
-            "/cmd/auto-install/test/test_python_script"
-        args = ["-n", "-m", testscript]
-
-        # TODO, write the testscript.sh
-
-        try:
-            self.AI = auto_install.AutoInstall(args)
-            self.assertNotEqual(self.AI, None)
-            self.AI.perform_autoinstall()
-            self.assertNotEqual(self.AI.exitval, self.AI.AI_EXIT_FAILURE)
-        except KeyboardInterrupt:
-            pass
-
-if __name__ == '__main__':
-    unittest.main()
--- a/usr/src/cmd/auto-install/test/test_python_script	Thu May 26 12:41:48 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#!/usr/bin/python2.6
-
-import os
-import sys
-
-sys_str = "pfexec cp -f " + os.environ['SRC'] + "/cmd/auto-install/test/profile_auto_reboot_true.xml /var/run/manifest.xml"
-ret = os.system(sys_str)
-sys.exit(ret)
--- a/usr/src/cmd/auto-install/test/test_shell_script.sh	Thu May 26 12:41:48 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/bash
-
-pfexec cp -f ${SRC}/cmd/auto-install/test/profile_auto_reboot_true.xml /var/run/manifest.xml
-
-exit $?
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_overlay.py	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_overlay.py	Fri May 27 09:34:25 2011 +0100
@@ -49,7 +49,7 @@
     # Provided files.
     ROOT = os.environ["ROOT"]
     BASE_MANIFEST = ROOT + "/usr/share/auto_install/ai_manifest.xml"
-    SCHEMA = ROOT + "/usr/share/auto_install/ai.dtd"
+    SCHEMA = ROOT + "/usr/share/install/ai.dtd"
 
     # Created files.
     AIM_MANIFEST_FILE = "/tmp/mim_test.xml"
@@ -854,7 +854,7 @@
         '''
         Interleaves two files with same nodes.  Verifies order.
         '''
-        values_order = ["target1", "target2", "software1", "software2",
+        values_order = ["target2", "software1", "software2",
                          "source1", "source2"]
 
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_pathing.py	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_pathing.py	Fri May 27 09:34:25 2011 +0100
@@ -83,7 +83,7 @@
         # suite of tests.  Indeed, the above xml file does not match it at all.
         root = os.environ["ROOT"]
         self.mim_obj = mim.ManifestInput("dummy", root +
-                                         "/usr/share/auto_install/ai.dtd")
+                                         "/usr/share/install/ai.dtd")
         self.mim_obj.load(self.MIM_TEST_XML_FILENAME)
 
     def tearDown(self):
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_validate_commit.py	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_validate_commit.py	Fri May 27 09:34:25 2011 +0100
@@ -45,7 +45,7 @@
 
     ROOT = os.environ["ROOT"]
     BASE_MANIFEST = ROOT + "/usr/share/auto_install/ai_manifest.xml"
-    SCHEMA = ROOT + "/usr/share/auto_install/ai.dtd"
+    SCHEMA = ROOT + "/usr/share/install/ai.dtd"
     AIM_MANIFEST_FILE = "/tmp/mim_test.xml"
     IN_XML_FILE = "/tmp/test_main.xml"
 
--- a/usr/src/tools/tests/tests.nose	Thu May 26 12:41:48 2011 -0700
+++ b/usr/src/tools/tests/tests.nose	Fri May 27 09:34:25 2011 +0100
@@ -30,4 +30,4 @@
 # the files in that directory should begin with "test_". Files
 # containing in-line doc-tests should be added explicitly.
 
-tests=lib/install_common/test/,lib/liberrsvc_pymod/test/,cmd/ai-webserver/test/,cmd/text-install/test/,cmd/installadm/test/,cmd/installadm/installadm_common.py,lib/install_utils/test/,lib/libict_pymod/test/,lib/install_logging_pymod/test,lib/install_doc/test,lib/install_engine/test,lib/install_manifest/test/,lib/install_transfer/test,cmd/distro_const/checkpoints/test,cmd/js2ai/modules/test/test_suite.py,lib/terminalui/test,cmd/system-config/profile/test/,cmd/system-config/test/,cmd/auto-install/test,cmd/auto-install/checkpoints/dmm/test,lib/install_manifest_input/test,lib/install_target/test/
+tests=lib/install_common/test/,lib/liberrsvc_pymod/test/,cmd/ai-webserver/test/,cmd/text-install/test/,cmd/installadm/test/,cmd/installadm/installadm_common.py,lib/install_utils/test/,lib/libict_pymod/test/,lib/install_logging_pymod/test,lib/install_doc/test,lib/install_engine/test,lib/install_manifest/test/,lib/install_transfer/test,cmd/distro_const/checkpoints/test,cmd/js2ai/modules/test/test_suite.py,lib/terminalui/test,cmd/system-config/profile/test/,cmd/system-config/test/,cmd/auto-install/test,lib/install_manifest_input/test,lib/install_target/test/