Example #1
0
    def write_empty_module_blacklist_test(self):
        """Test write kernel module blacklist to the install root -- empty list."""
        with TemporaryDirectory() as temp:
            write_module_blacklist(temp)

            blacklist_file = os.path.join(temp, "etc/modprobe.d/anaconda-blacklist.conf")

            self.assertFalse(os.path.isfile(blacklist_file))
Example #2
0
    def write_module_blacklist_test(self):
        """Test write kernel module blacklist to the install root."""
        with TemporaryDirectory() as temp:
            write_module_blacklist(temp)

            blacklist_file = os.path.join(temp, "etc/modprobe.d/anaconda-blacklist.conf")

            self.assertTrue(os.path.isfile(blacklist_file))

            with open(blacklist_file, "rt") as f:
                expected_content = """
                # Module blacklists written by anaconda
                blacklist mod1
                blacklist mod2
                blacklist nonono_mod
                """
                self.assertEqual(dedent(expected_content).lstrip(), f.read())
Example #3
0
 def run(self):
     """Create a root and write module blacklist."""
     create_root_dir(self._sysroot)
     write_module_blacklist(self._sysroot)