Beispiel #1
0
    def test_cpuinfo_freebsd(self):
        m = self._set_up_test_cpuinfo_bsd()
        sysctl = 'hw.model:Intel(R) Core(TM) i5-7287U CPU @ 3.30GHz\nhw.ncpu:4'

        with patch.dict(status.__grains__, {'kernel': 'FreeBSD'}):
            with patch.dict(status.__salt__, {'cmd.run': MagicMock(return_value=sysctl)}):
                ret = status.cpuinfo()
                self.assertDictEqual(ret, m.ret)
Beispiel #2
0
    def test_cpuinfo_openbsd(self):
        m = self._set_up_test_cpuinfo_bsd()
        sysctl = 'hw.model=Intel(R) Core(TM) i5-7287U CPU @ 3.30GHz\nhw.ncpu=4'

        for bsd in ['NetBSD', 'OpenBSD']:
            with patch.dict(status.__grains__, {'kernel': bsd}):
                with patch.dict(status.__salt__, {'cmd.run': MagicMock(return_value=sysctl)}):
                    ret = status.cpuinfo()
                    self.assertDictEqual(ret, m.ret)