@@ -0,0 +1,2078 @@
+#!/usr/bin/env python2%0A# OpenPOWER Automated Test Project%0A#%0A# Contributors Listed Below - COPYRIGHT 2019%0A# %5B+%5D International Business Machines Corp.%0A#%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#     http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A# implied. See the License for the specific language governing%0A# permissions and limitations under the License.%0A#%0A%0A'''%0APetitboot MMU%0A----------%0A%0AThis test verifies that the petitboot kernel has booted with the expected MMU mode%0Afor the processor. This means hash for P8 and radix for P9 onwards.%0A'''%0A%0Aimport unittest%0A%0Aimport logging%0Aimport OpTestConfiguration%0Aimport OpTestLogger%0Afrom common.OpTestSystem import OpSystemState%0A%0Alog = OpTestLogger.optest_logger_glob.get_logger(__name__)%0A%0Aclass PetitbootMMU(unittest.TestCase):%0A%0A    def setUp(self):%0A        conf = OpTestConfiguration.conf%0A        self.cv_HOST = conf.host()%0A        self.cv_IPMI = conf.ipmi()%0A        self.cv_SYSTEM = conf.system()%0A%0A    def runTest(self):%0A        self.cv_SYSTEM.goto_state(OpSystemState.PETITBOOT_SHELL)%0A        self.c = self.cv_SYSTEM.console%0A%0A        log.debug(%22Scraping /proc/cpuinfo for CPU and MMU info%22)%0A        cpu = self.c.run_command(%22awk '$1 == %5C%22cpu%5C%22 %7Bprint $3%7D' /proc/cpuinfo %7C uniq%22)%5B0%5D.strip(',')%0A        mmu = self.c.run_command(%22awk '$1 == %5C%22MMU%5C%22 %7Bprint $3%7D' /proc/cpuinfo%22)%5B0%5D%0A        log.debug(%22Got CPU '%7B%7D' and MMU '%7B%7D'%22.format(cpu, mmu))%0A%0A        if cpu == 'POWER8':%0A            self.assertEqual(mmu, 'Hash', 'Expect hash MMU on Power8, found %7B%7D'.format(mmu))%0A        elif cpu == 'POWER9':%0A            self.assertEqual(mmu, 'Radix', 'Expect radix MMU on Power9, found %7B%7D'.format(mmu))%0A        else:%0A            self.skipTest(%22Unknown CPU '%7B%7D', please update testcase to support this CPU%22)%0A

Add check for the MMU type under petitboot