summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/setup.cfg2
-rw-r--r--scripts/tests/02_wic_test_directdisk.py61
2 files changed, 62 insertions, 1 deletions
diff --git a/scripts/setup.cfg b/scripts/setup.cfg
index 48a0bb2f4f..f378efa642 100644
--- a/scripts/setup.cfg
+++ b/scripts/setup.cfg
@@ -3,4 +3,4 @@ verbosity=2
3exe=1 3exe=1
4with-coverage=1 4with-coverage=1
5cover-erase=1 5cover-erase=1
6cover-package=wic,image 6cover-package=wic,image,wic.imager
diff --git a/scripts/tests/02_wic_test_directdisk.py b/scripts/tests/02_wic_test_directdisk.py
new file mode 100644
index 0000000000..9108621fbe
--- /dev/null
+++ b/scripts/tests/02_wic_test_directdisk.py
@@ -0,0 +1,61 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (c) 2015, Intel Corporation.
6# All rights reserved.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program 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
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# AUTHORS
22# Ed Bartosh <ed.bartosh@linux.intel.com>
23
24"""Test directdisk builds."""
25
26import imp
27import unittest
28import os
29import shutil
30import glob
31
32class TestWicDirectdisk(unittest.TestCase):
33 """Test build of directdisk image"""
34 def __init__(self, methodName='runTest'):
35 unittest.TestCase.__init__(self, methodName)
36 self.main = imp.load_source("wic", "wic").main
37 self.resultdir = "/var/tmp/wic/build/"
38
39 def setUp(self):
40 """This code executes before each test method."""
41 shutil.rmtree(self.resultdir)
42 os.chdir(os.getenv("BUILDDIR"))
43
44 def _build(self, cmdline):
45 """Call self.main with provided commandline."""
46 self.assertIsNone(self.main(cmdline))
47 self.assertEqual(1, len(glob.glob(self.resultdir + \
48 "directdisk-*.direct")))
49
50 def testbuild_image_name(self):
51 self._build(["create", "directdisk",
52 "--image-name", "core-image-minimal"])
53
54 def testbuild_artifacts(self):
55 self._build(["create", "directdisk",
56 "-b", "tmp/sysroots/qemux86/usr/share",
57 "-k", "tmp/deploy/images/qemux86",
58 "-n", "tmp/sysroots/x86_64-linux",
59 "-r", "tmp/work/qemux86-poky-linux/"
60 "core-image-minimal/1.0-r0/rootfs"])
61