qubes_create.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #
  2. # The Qubes OS Project, https://www.qubes-os.org/
  3. #
  4. # Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
  5. # Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
  6. #
  7. # This library is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU Lesser General Public
  9. # License as published by the Free Software Foundation; either
  10. # version 2.1 of the License, or (at your option) any later version.
  11. #
  12. # This library is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. # Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with this library; if not, see <https://www.gnu.org/licenses/>.
  19. #
  20. import qubes
  21. import qubes.tools.qubes_create
  22. import qubes.tests
  23. @qubes.tests.skipUnlessDom0
  24. class TC_00_qubes_create(qubes.tests.SystemTestCase):
  25. def test_000_basic(self):
  26. self.assertEqual(0, qubes.tools.qubes_create.main([
  27. '--qubesxml', qubes.tests.XMLPATH]))
  28. def test_001_property(self):
  29. self.assertEqual(0, qubes.tools.qubes_create.main([
  30. '--qubesxml', qubes.tests.XMLPATH,
  31. '--property', 'default_kernel=testkernel']))
  32. self.assertEqual('testkernel',
  33. qubes.Qubes(qubes.tests.XMLPATH).default_kernel)