7040825 Additional 19 slim_unit tests failure after putback of 7938729.
authorJack Schwartz <Jack.Schwartz@Oracle.COM>
Thu, 05 May 2011 11:43:50 -0700
changeset 1109 ad13b6eeaad4
parent 1108 13b0554a5b33
child 1110 17d2e44bfc3f
7040825 Additional 19 slim_unit tests failure after putback of 7938729. 7041119 Error message needed for when svccfg fails to add AI service version 7042007 Manifest Input module should use a DTD listed in manifest only if accessible
usr/src/cmd/installadm/svc-install-server
usr/src/lib/install_manifest_input/mim.py
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
--- a/usr/src/cmd/installadm/svc-install-server	Thu May 05 08:27:33 2011 -0700
+++ b/usr/src/cmd/installadm/svc-install-server	Thu May 05 11:43:50 2011 -0700
@@ -197,6 +197,7 @@
 		    "${version}" -ge "${AI_SERVICE_VERSION}" ]; then
 			continue
 		fi
+                errors=n
 
 		service_name=$(${SVCPROP} -cp \
 		    ${service}/service_name ${SMF_FMRI})
@@ -240,24 +241,33 @@
 				    -n ${service_name} -d -f ${default_file}
 				if [[ $? -eq 0 ]]; then
 					${RM} ${default_file}
-
-					# Install version for this AI service
-					${SVCCFG} -s ${SMF_FMRI} setprop \
-					    ${service}/version = \
-					    astring: \"${AI_SERVICE_VERSION}\"
 				else
+					errors=y
 					echo "Error running installadm."
-					echo "Upgrade of service " \
-					    "${service_name} not completed."
 				fi
 
 			else
+				errors=y
 				echo "Unable to find default manifest for " \
 				    "install service ${service_name}"
-				echo "Upgrade of service ${service_name} " \
-				    "not completed"
 			fi
 		fi
+
+		if [ $errors = "n" ] ; then
+			# Install version for this AI service
+			${SVCCFG} -s ${SMF_FMRI} setprop ${service}/version = \
+			    astring: \"${AI_SERVICE_VERSION}\"
+			if [[ $? -ne 0 ]]; then
+				echo "Error running svccfg to " \
+				    "update service version."
+				errors=y
+			fi
+		fi
+
+		if [ $errors = "y" ] ; then
+			echo "Upgrade of service " \
+			    "${service_name} not completed."
+		fi
 	done
 
 	if [ $do_refresh = "y" ] ; then
--- a/usr/src/lib/install_manifest_input/mim.py	Thu May 05 08:27:33 2011 -0700
+++ b/usr/src/lib/install_manifest_input/mim.py	Thu May 05 11:43:50 2011 -0700
@@ -184,7 +184,9 @@
 
         # Use the schema refered to in the manifest itself, if it is listed in
         # the manifest and it exists.  Else use the schema passed in as an arg.
-        if self.tree and self.tree.docinfo and self.tree.docinfo.system_url:
+        if (self.tree and self.tree.docinfo and
+            self.tree.docinfo.system_url and
+            os.access(self.tree.docinfo.system_url, os.R_OK)):
             schema_file = self.tree.docinfo.system_url
 
         if schema_file is None:
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_overlay.py	Thu May 05 08:27:33 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_overlay.py	Thu May 05 11:43:50 2011 -0700
@@ -46,10 +46,13 @@
     Common setup for Overlay testing.
     '''
 
-    BASE_MANIFEST = "/usr/share/auto_install/default.xml"
-    SCHEMA = "/usr/share/install/ai.dtd"
+    # Provided files.
+    ROOT = os.environ["ROOT"]
+    BASE_MANIFEST = ROOT + "/usr/share/auto_install/ai_manifest.xml"
+    SCHEMA = ROOT + "/usr/share/auto_install/ai.dtd"
+
+    # Created files.
     AIM_MANIFEST_FILE = "/tmp/mim_test.xml"
-
     MAIN_XML_FILE = "/tmp/test_main.xml"
     OVERLAY_XML_FILE = "/tmp/test_overlay.xml"
 
@@ -61,24 +64,36 @@
         Specify where the manifest will be built.  Start with no data.
         '''
         os.environ["AIM_MANIFEST"] = self.AIM_MANIFEST_FILE
+
+    def tearDown(self):
+        '''
+        Remove files created during testing.
+        '''
         if os.path.exists(self.AIM_MANIFEST_FILE):
             os.unlink(self.AIM_MANIFEST_FILE)
 
-    # More descriptive arg name to pass to method below "with_target" arg.
-    WITH_TARGET = True
+    # More descriptive arg name to pass to method below "with_software" arg.
+    WITH_SOFTWARE = True
 
-    def create_starting_file(self, with_target=False):
+    def create_starting_file(self, with_software=False):
         '''
         Create an XML file most tests start with.
         '''
         with open(self.MAIN_XML_FILE, "w") as main_xml:
             main_xml.write('<auto_install>\n')
             main_xml.write('  <ai_instance name="firstname">\n')
-            if with_target:
-                main_xml.write('    <target/>\n')
+            if with_software:
+                main_xml.write('    <software/>\n')
             main_xml.write('  </ai_instance>\n')
             main_xml.write('</auto_install>\n')
 
+    def destroy_starting_file(self):
+        '''
+        Destroy file created by create_starting_file().
+        '''
+        if os.path.exists(self.MAIN_XML_FILE):
+            os.unlink(self.MAIN_XML_FILE)
+
 
 class TestOverlayA(TestMIMOverlayCommon):
     '''
@@ -95,12 +110,12 @@
     FULL_XML = "/tmp/test_full.xml"
 
     # Names of the XML files which hold one section apiece.
-    SC_EMB_MAN_XML = "/tmp/test_sc_embedded_manifest.xml"
+    TARGET_XML = "/tmp/test_target.xml"
     SOFTWARE_XML = "/tmp/test_software.xml"
     ADD_DRIVER_XML = "/tmp/test_add_drivers.xml"
 
     # Paths to roots of each of the three sections.
-    SC_EMB_SUBTREE = "/auto_install/ai_instance/sc_embedded_manifests"
+    TARGET_SUBTREE = "/auto_install/ai_instance/target"
     SOFTWARE_SUBTREE = "/auto_install/ai_instance/software"
     ADD_DRIVER_SUBTREE = "/auto_install/ai_instance/add_drivers"
 
@@ -145,24 +160,38 @@
         # Generate the three files with subsections.
         self.prune(self.ADD_DRIVER_SUBTREE)
         self.prune(self.SOFTWARE_SUBTREE)
-        self.tree.write(self.SC_EMB_MAN_XML, pretty_print=True)
+        self.tree.write(self.TARGET_XML, pretty_print=True)
 
         self.tree = etree.parse(self.BASE_MANIFEST, parser)
         self.prune(self.ADD_DRIVER_SUBTREE)
-        self.prune(self.SC_EMB_SUBTREE)
+        self.prune(self.TARGET_SUBTREE)
         self.tree.write(self.SOFTWARE_XML, pretty_print=True)
 
         self.tree = etree.parse(self.BASE_MANIFEST, parser)
-        self.prune(self.SC_EMB_SUBTREE)
+        self.prune(self.TARGET_SUBTREE)
         self.prune(self.SOFTWARE_SUBTREE)
         self.tree.write(self.ADD_DRIVER_XML, pretty_print=True)
 
+    def tearDown(self):
+        '''
+        Remove files created during testing.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        if os.path.exists(self.FULL_XML):
+            os.unlink(self.FULL_XML)
+        if os.path.exists(self.TARGET_XML):
+            os.unlink(self.TARGET_XML)
+        if os.path.exists(self.SOFTWARE_XML):
+            os.unlink(self.SOFTWARE_XML)
+        if os.path.exists(self.ADD_DRIVER_XML):
+            os.unlink(self.ADD_DRIVER_XML)
+
     def test_overlay_1(self):
         '''
         Put original manifest together from pieces, and verify it.
         '''
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
-        mim.load(self.SC_EMB_MAN_XML, not self.OVERLAY)
+        mim.load(self.TARGET_XML, not self.OVERLAY)
         mim.load(self.ADD_DRIVER_XML, self.OVERLAY)
         mim.load(self.SOFTWARE_XML, self.OVERLAY)
         mim.commit()
@@ -174,16 +203,33 @@
 
 class TestOverlayBCommon(TestMIMOverlayCommon):
 
-    def do_test(self):
+    def setUp(self):
+        '''
+        Create an overlay file.
         '''
-        Create an overlay file.  Load main, then overlay and test.
-        '''
+        TestMIMOverlayCommon.setUp(self)
+
+        self.create_starting_file(self.WITH_SOFTWARE)
+
         with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
             ovrl_xml.write('<auto_install>\n')
             ovrl_xml.write('  <ai_instance name="secondname">\n')
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+
+        TestMIMOverlayCommon.tearDown(self)
+
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
+    def do_test(self):
+        '''
+        Load main, then overlay and test.
+        '''
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         mim.load(self.OVERLAY_XML_FILE, self.OVERLAY)
@@ -198,38 +244,80 @@
 
 class TestOverlay2(TestOverlayBCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        TestOverlayBCommon.setUp(self)
+        self.create_starting_file(self.WITH_SOFTWARE)
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestOverlayBCommon.tearDown(self)
+        self.destroy_starting_file()
+
     def test_overlay_2(self):
         '''
         Change an attribute of an existing non-leaf element.
         '''
-        self.create_starting_file(self.WITH_TARGET)
         self.do_test()
 
 
 class TestOverlay3(TestOverlayBCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        TestOverlayBCommon.setUp(self)
+        self.create_starting_file()
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestOverlayBCommon.tearDown(self)
+        self.destroy_starting_file()
+        
     def test_overlay_3(self):
         '''
         Change an attribute of an existing non-leaf element.
         '''
-        self.create_starting_file()
         self.do_test()
 
 
 class TestOverlay4(TestMIMOverlayCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        TestMIMOverlayCommon.setUp(self)
+        self.create_starting_file(self.WITH_SOFTWARE)
+
+        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
+            ovrl_xml.write('<auto_install>\n')
+            ovrl_xml.write('  <ai_instance auto_reboot="true"/>\n')
+            ovrl_xml.write('</auto_install>\n')
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_4(self):
         '''
         Leaf overlayed where same-tagged elements not allowed
 
         ... replaces existing element and any subtree from it.
         '''
-        self.create_starting_file(self.WITH_TARGET)
-
-        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
-            ovrl_xml.write('<auto_install>\n')
-            ovrl_xml.write('  <ai_instance auto_reboot="true"/>\n')
-            ovrl_xml.write('</auto_install>\n')
 
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
@@ -250,22 +338,36 @@
 
 class TestOverlay5(TestMIMOverlayCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        self.create_starting_file(self.WITH_SOFTWARE)
+
+        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
+            ovrl_xml.write('<auto_install>\n')
+            ovrl_xml.write('  <ai_instance auto_reboot="true">\n')
+            ovrl_xml.write('    <software>\n')
+            ovrl_xml.write('    </software>\n')
+            ovrl_xml.write('  </ai_instance>\n')
+            ovrl_xml.write('</auto_install>\n')
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_5(self):
         '''
         Overlay same-tagged non-leaf element with new attr where not allowed.
 
         Same-tagged non-leaf elements are not allowed.
         '''
-        self.create_starting_file(self.WITH_TARGET)
-
-        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
-            ovrl_xml.write('<auto_install>\n')
-            ovrl_xml.write('  <ai_instance auto_reboot="true">\n')
-            ovrl_xml.write('    <target>\n')
-            ovrl_xml.write('    </target>\n')
-            ovrl_xml.write('  </ai_instance>\n')
-            ovrl_xml.write('</auto_install>\n')
-
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         mim.load(self.OVERLAY_XML_FILE, self.OVERLAY)
@@ -288,6 +390,31 @@
 
 class TestOverlay6(TestMIMOverlayCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        TestMIMOverlayCommon.setUp(self)
+
+        self.create_starting_file(self.WITH_SOFTWARE)
+
+        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
+            ovrl_xml.write('<auto_install>\n')
+            ovrl_xml.write('  <ai_instance>\n')
+            ovrl_xml.write('    <bogus/>\n')
+            ovrl_xml.write('  </ai_instance>\n')
+            ovrl_xml.write('</auto_install>\n')
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_6(self):
         '''
         Try to overlay a leaf element (id by value) where it does not belong.
@@ -296,15 +423,6 @@
         '''
         # Note: giving a bogus attribute is not checked, only a bogus element.
 
-        self.create_starting_file(self.WITH_TARGET)
-
-        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
-            ovrl_xml.write('<auto_install>\n')
-            ovrl_xml.write('  <ai_instance>\n')
-            ovrl_xml.write('    <bogus/>\n')
-            ovrl_xml.write('  </ai_instance>\n')
-            ovrl_xml.write('</auto_install>\n')
-
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         self.assertRaises(milib.MimInvalidError, mim.load,
@@ -313,13 +431,13 @@
 
 class TestOverlay7(TestMIMOverlayCommon):
 
-    def test_overlay_7(self):
+    def setUp(self):
         '''
-        Try to overlay a leaf element (id by attr) where it does not belong.
+        Create needed files.
+        '''
+        TestMIMOverlayCommon.setUp(self)
 
-        Give element an attribute to identify it.
-        '''
-        self.create_starting_file(self.WITH_TARGET)
+        self.create_starting_file(self.WITH_SOFTWARE)
 
         with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
             ovrl_xml.write('<auto_install>\n')
@@ -328,6 +446,22 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
+    def test_overlay_7(self):
+        '''
+        Try to overlay a leaf element (id by attr) where it does not belong.
+
+        Give element an attribute to identify it.
+        '''
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         self.assertRaises(milib.MimInvalidError, mim.load,
@@ -336,61 +470,93 @@
 
 class TestOverlay8(TestMIMOverlayCommon):
 
+    def setUp(self):
+        '''
+        Create needed files.
+        '''
+        TestMIMOverlayCommon.setUp(self)
+
+        self.create_starting_file(self.WITH_SOFTWARE)
+
+        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
+            ovrl_xml.write('<auto_install>\n')
+            ovrl_xml.write('  <ai_instance>\n')
+            ovrl_xml.write('    <software>\n')
+            ovrl_xml.write('      <software_data action="install"/>\n')
+            ovrl_xml.write('    </software>\n')
+            ovrl_xml.write('  </ai_instance>\n')
+            ovrl_xml.write('</auto_install>\n')
+
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_8(self):
         '''
         Add a new non-leaf element where same-tagged elements are allowed.
         '''
-        self.create_starting_file(self.WITH_TARGET)
-
-        with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
-            ovrl_xml.write('<auto_install>\n')
-            ovrl_xml.write('  <ai_instance>\n')
-            ovrl_xml.write('    <target>\n')
-            ovrl_xml.write('      <disk disk_name="newdisk"/>\n')
-            ovrl_xml.write('    </target>\n')
-            ovrl_xml.write('  </ai_instance>\n')
-            ovrl_xml.write('</auto_install>\n')
-
         mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         mim.load(self.OVERLAY_XML_FILE, self.OVERLAY)
 
         (value, path) = mim.get("/auto_install/ai_instance/"
-                                "target/disk@disk_name")
-        self.assertEquals(value, "newdisk",
+                                "software/software_data@action")
+        self.assertEquals(value, "install",
                           "Error adding new same-tagged element")
 
         # Target[2] means a second element was (properly) added.
-        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/target[2]"
-                          "/disk[1]@disk_name",
+        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/software[2]"
+                          "/software_data[1]@action",
                           "Error: incorrect pathname returned when getting "
                           "newly added element.")
 
 
 class TestOverlay9(TestMIMOverlayCommon):
 
-    def test_overlay_9(self):
+    def setUp(self):
         '''
-        Add new leaf elem where same-tagged elements are allowed and none exist
+        Create needed files.
         '''
+        TestMIMOverlayCommon.setUp(self)
+
         self.create_starting_file()
 
         with open(self.OVERLAY_XML_FILE, "w") as ovrl_xml:
             ovrl_xml.write('<auto_install>\n')
             ovrl_xml.write('  <ai_instance>\n')
-            ovrl_xml.write('    <target/>\n')
+            ovrl_xml.write('    <software/>\n')
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
+    def test_overlay_9(self):
+        '''
+        Add new leaf elem where same-tagged elements are allowed and none exist
+        '''
         #pylint: disable-msg=W0201
         self.mim = ManifestInput(self.AIM_MANIFEST_FILE, self.SCHEMA)
         self.mim.load(self.MAIN_XML_FILE, not self.OVERLAY)
         self.mim.load(self.OVERLAY_XML_FILE, self.OVERLAY)
 
-        # Target[1] means a first target element was (properly) added.
+        # Software[1] means a first software element was (properly) added.
         #pylint: disable-msg=W0612
-        (value, path) = self.mim.get("/auto_install/ai_instance/target")
-        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/target[1]",
+        (value, path) = self.mim.get("/auto_install/ai_instance/software")
+        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/software[1]",
                           "Error adding leaf element where like-tagged "
                           "elements are allowed.")
 
@@ -404,10 +570,10 @@
         self.test_overlay_9()
         self.mim.load(self.OVERLAY_XML_FILE, self.OVERLAY)
 
-        # Target[2] means a second target element was (properly) added.
+        # software[2] means a second software element was (properly) added.
         #pylint: disable-msg=W0612
-        (value, path) = self.mim.get("/auto_install/ai_instance/target[2]")
-        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/target[2]",
+        (value, path) = self.mim.get("/auto_install/ai_instance/software[2]")
+        self.assertEquals(path, "/auto_install[1]/ai_instance[1]/software[2]",
                           "Error adding second like-tagged leaf element.")
 
 
@@ -471,6 +637,17 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestOverlayInsertionOrderCommon.tearDown(self)
+
+        if os.path.exists(self.MAIN_XML_FILE):
+            os.unlink(self.MAIN_XML_FILE)
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_11(self):
         '''
         Verify that software section went between target and add_drivers.
@@ -503,6 +680,17 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestOverlayInsertionOrderCommon.tearDown(self)
+
+        if os.path.exists(self.MAIN_XML_FILE):
+            os.unlink(self.MAIN_XML_FILE)
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_12(self):
         '''
         Verify that target section went before software and add_drivers.
@@ -535,6 +723,17 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestOverlayInsertionOrderCommon.tearDown(self)
+
+        if os.path.exists(self.MAIN_XML_FILE):
+            os.unlink(self.MAIN_XML_FILE)
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_13(self):
         '''
         Verify that add_drivers section went after target and software.
@@ -569,6 +768,17 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+
+        if os.path.exists(self.MAIN_XML_FILE):
+            os.unlink(self.MAIN_XML_FILE)
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_14(self):
         '''
         Verify that add_drivers goes after target.
@@ -630,6 +840,16 @@
             ovrl_xml.write('  </ai_instance>\n')
             ovrl_xml.write('</auto_install>\n')
 
+    def tearDown(self):
+        '''
+        Destroy files created for these tests.
+        '''
+        TestMIMOverlayCommon.tearDown(self)
+        self.destroy_starting_file()
+
+        if os.path.exists(self.OVERLAY_XML_FILE):
+            os.unlink(self.OVERLAY_XML_FILE)
+
     def test_overlay_15(self):
         '''
         Interleaves two files with same nodes.  Verifies order.
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_pathing.py	Thu May 05 08:27:33 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_pathing.py	Thu May 05 11:43:50 2011 -0700
@@ -41,57 +41,55 @@
 
     MIM_TEST_XML_FILENAME = "/tmp/mim_test.xml"
 
-    FILE_CREATED = False
-
     # Eventually bring names into convention.
     #pylint: disable-msg=C0103
     def setUp(self):
         '''
         Create an XML file used for all tests, and set up environment.
         '''
-        # All setup need be done only once.  All tests are readonly.
-        if not TestMIMPathing.FILE_CREATED:
-
-            # Create test XML file.
-            # This will be used for get / path-processing tests.
-            with open(self.MIM_TEST_XML_FILENAME, "w") as test_xml:
+        # Create test XML file.
+        # This will be used for get / path-processing tests.
+        with open(self.MIM_TEST_XML_FILENAME, "w") as test_xml:
 
-                # Create/modify the file here.
-                test_xml.write('<a>\n')
-                test_xml.write('  aval\n')
-                test_xml.write('  <b battr="b1attr" bbattr="bb1attrval">\n')
-                test_xml.write('    bval1\n')
-                test_xml.write('    <c cattr="c1attr">\n')
-                test_xml.write('      cval1\n')
-                test_xml.write('      <d dattr="d1attr">')
-                test_xml.write('        dval1\n')
-                test_xml.write('        <e>')
-                test_xml.write('          eval1\n')
-                test_xml.write('        </e>')
-                test_xml.write('      </d>\n')
-                test_xml.write('    </c>\n')
-                test_xml.write('  </b>\n')
-                test_xml.write('  <b battr="b2attr" bbattr="bb2attrval">\n')
-                test_xml.write('    bval2\n')
-                test_xml.write('    <c cattr="c2attr">\n')
-                test_xml.write('      cval2\n')
-                test_xml.write('      <d dattr="d2attr">')
-                test_xml.write('        dval2\n')
-                test_xml.write('      </d>\n')
-                test_xml.write('    </c>\n')
-                test_xml.write('  </b>\n')
-                test_xml.write('</a>\n')
-
-            TestMIMPathing.FILE_CREATED = True
+            # Create/modify the file here.
+            test_xml.write('<a>\n')
+            test_xml.write('  aval\n')
+            test_xml.write('  <b battr="b1attr" bbattr="bb1attrval">\n')
+            test_xml.write('    bval1\n')
+            test_xml.write('    <c cattr="c1attr">\n')
+            test_xml.write('      cval1\n')
+            test_xml.write('      <d dattr="d1attr">')
+            test_xml.write('        dval1\n')
+            test_xml.write('        <e>')
+            test_xml.write('          eval1\n')
+            test_xml.write('        </e>')
+            test_xml.write('      </d>\n')
+            test_xml.write('    </c>\n')
+            test_xml.write('  </b>\n')
+            test_xml.write('  <b battr="b2attr" bbattr="bb2attrval">\n')
+            test_xml.write('    bval2\n')
+            test_xml.write('    <c cattr="c2attr">\n')
+            test_xml.write('      cval2\n')
+            test_xml.write('      <d dattr="d2attr">')
+            test_xml.write('        dval2\n')
+            test_xml.write('      </d>\n')
+            test_xml.write('    </c>\n')
+            test_xml.write('  </b>\n')
+            test_xml.write('</a>\n')
 
         os.environ["AIM_MANIFEST"] = self.MIM_TEST_XML_FILENAME
 
         # Note: while a valid DTD must be passed in, it is not used for this
         # suite of tests.  Indeed, the above xml file does not match it at all.
-        self.mim_obj = mim.ManifestInput("dummy",
+        root = os.environ["ROOT"]
+        self.mim_obj = mim.ManifestInput("dummy", root +
                                          "/usr/share/auto_install/ai.dtd")
         self.mim_obj.load(self.MIM_TEST_XML_FILENAME)
 
+    def tearDown(self):
+        if os.path.exists(self.MIM_TEST_XML_FILENAME):
+            os.unlink(self.MIM_TEST_XML_FILENAME)
+
     def test_path_1(self):
         '''Access item w/simple path'''
         rval, path = self.mim_obj.get("/a")
--- a/usr/src/lib/install_manifest_input/test/test_manifest_input_validate_commit.py	Thu May 05 08:27:33 2011 -0700
+++ b/usr/src/lib/install_manifest_input/test/test_manifest_input_validate_commit.py	Thu May 05 11:43:50 2011 -0700
@@ -43,8 +43,9 @@
     Tests for Manifest Input Module Validate and Commit functionality.
     '''
 
-    BASE_MANIFEST = "/usr/share/auto_install/default.xml"
-    SCHEMA = "/usr/share/install/ai.dtd"
+    ROOT = os.environ["ROOT"]
+    BASE_MANIFEST = ROOT + "/usr/share/auto_install/ai_manifest.xml"
+    SCHEMA = ROOT + "/usr/share/auto_install/ai.dtd"
     AIM_MANIFEST_FILE = "/tmp/mim_test.xml"
     IN_XML_FILE = "/tmp/test_main.xml"
 
@@ -56,6 +57,15 @@
         '''
         os.environ["AIM_MANIFEST"] = self.AIM_MANIFEST_FILE
 
+    def tearDown(self):
+        '''
+        Remove any files created during tests.
+        '''
+        if os.path.exists(self.AIM_MANIFEST_FILE):
+            os.unlink(self.AIM_MANIFEST_FILE)
+        if os.path.exists(self.IN_XML_FILE):
+            os.unlink(self.IN_XML_FILE)
+
     def create_small_xml(self):
         '''
         Create a small XML file which doesn't match the AI DTD.