Esempio n. 1
0
    def run(self):
        # Move to config_tests.xml once that's ready.
        self._case.set_value("CONTINUE_RUN", False)
        self._case.set_value("REST_OPTION", "never")
        self._case.set_value("HIST_OPTION", "$STOP_OPTION")
        self._case.set_value("HIST_N", "$STOP_N")
        self._case.flush()

        stop_n      = self._case.get_value("STOP_N")
        stop_option = self._case.get_value("STOP_OPTION")
        exeroot = self._case.get_value("EXEROOT")
        cime_model = self._case.get_value("MODEL")

        #
        # do an initial run test with default layout
        #
        logger.info("doing a %d %s initial test with default layout" % (stop_n, stop_option))

        shutil.copy("%s/%s.exe.SEQ1"%(exeroot,cime_model),
                    "%s/%s.exe"%(exeroot,cime_model))
        shutil.copy(os.path.join("LockedFiles", "env_mach_pes.SEQ1.xml"), "env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml", os.path.join("LockedFiles", "env_mach_pes.xml"))
        success = SystemTestsCommon._run(self)
        if not success:
            return False
        shutil.copy(os.path.join("LockedFiles", "env_mach_pes.SEQ2.xml"), "env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml", os.path.join("LockedFiles", "env_mach_pes.xml"))

        logger.info("doing a second %d %s test with rootpes set to zero" % (stop_n, stop_option))
        shutil.copy("%s/%s.exe.SEQ1"%(exeroot,cime_model),
                    "%s/%s.exe"%(exeroot,cime_model))
        success = SystemTestsCommon._run(self, "seq")

        if success:
            return self._component_compare_test("base", "seq")
        else:
            return False