Commit 68e13b12 authored by Michael Pöhn's avatar Michael Pöhn

initial implementation

parents
fdroid-jessie64.box
tests/extra/test-libvirt/.vagrant
tests/extra/test-virtualbox/.vagrant
__pycache__/
.*.swp
This diff is collapsed.
This diff is collapsed.
Vagrant.configure("2") do |config|
config.vm.box = "fdroid-jessie64"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
libvirt.host = "localhost"
libvirt.uri = "qemu:///system"
# libvirt.cpus = 1
# libvirt.memory = 1024
# libvirt.connect_via_ssh = false
end
end
Vagrant.configure("2") do |config|
config.vm.box = "fdroid-jessie64"
config.ssh.password = "vagrant"
config.ssh.username = "vagrant"
end
#!/usr/bin/env python3
import inspect
import logging
import optparse
import os
import sys
import unittest
import tempfile
localmodule = os.path.realpath(
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
print('localmodule: ' + localmodule)
if localmodule not in sys.path:
sys.path.insert(0, localmodule)
import makebuildserver_basebox
class MkBsBoxTest(unittest.TestCase):
'''tests makebuildserver_basebox.py'''
def setUp(self):
logging.basicConfig(level=logging.DEBUG)
self.basedir = os.path.join(localmodule, 'tests')
self.tmpdir = os.path.abspath(os.path.join(self.basedir, '..', '.testfiles'))
if not os.path.exists(self.tmpdir):
os.makedirs(self.tmpdir)
os.chdir(self.basedir)
def test_write_bootstrap_script(self):
with tempfile.TemporaryDirectory() as tmpdir:
path = os.path.join(tmpdir, 'script.sh')
makebuildserver_basebox.write_bootstrap_script(
path, 'theUsersName')
self.assertTrue(os.path.isfile(path))
self.assertTrue(os.access(path, os.X_OK))
def test_main(self):
self.assertRaisesRegex(makebuildserver_basebox.BaseboxException,
"This script requires super user privileges.+",
makebuildserver_basebox.main,
provider='unsupported_value')
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-v", "--verbose", action="store_true", default=False,
help="Spew out even more information than normal")
options, args = parser.parse_args(['--verbose'])
newSuite = unittest.TestSuite()
newSuite.addTest(unittest.makeSuite(MkBsBoxTest))
unittest.main(failfast=False)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment