Permalink
Browse files

Merge pull request #78 from panlinux/enable-tests-package-build

Enable tests during package build
  • Loading branch information...
2 parents 4f6740e + 05c8944 commit f3b6bfac5911f248499c79a42a0d18f12ca9065a @panlinux panlinux committed Oct 27, 2017
Showing with 13 additions and 3 deletions.
  1. +2 −1 debian/control
  2. +2 −2 debian/rules
  3. +9 −0 tests/test_fips.py
View
@@ -2,7 +2,8 @@ Source: ubuntu-advantage-tools
Section: misc
Priority: important
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
-Build-Depends: debhelper (>=9)
+Build-Depends: debhelper (>=9), flake8 | python3-flake8, python3 (>= 3.4), fakeroot,
+ python3-fixtures, lsb-release
Standards-Version: 3.9.6
Homepage: https://buy.ubuntu.com
Vcs-Git: https://github.com/CanonicalLtd/ubuntu-advantage-script.git
View
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
%:
dh $@
-
override_dh_auto_test:
- @echo "Skipping tests during package builds."
+ python3 -m unittest discover tests
+ flake8 tests
View
@@ -6,6 +6,7 @@
class FIPSTest(UbuntuAdvantageTest):
SERIES = 'xenial'
+ ARCH = 'x86_64'
def test_enable_fips(self):
"""The enable-fips option enables the FIPS repository."""
@@ -69,6 +70,14 @@ def test_enable_fips_writes_config_s390x_parameters(self):
self.script('enable-fips', 'user:pass')
self.assertEqual('parameters=foo fips=1\n', self.boot_cfg.read_text())
+ def test_unsupported_on_i686(self):
+ """FIPS is unsupported on i686 arch."""
+ self.ARCH = 'i686'
+ process = self.script('enable-fips', 'user:pass')
+ self.assertEqual(6, process.returncode)
+ self.assertEqual(
+ 'FIPS is not supported on i686.', process.stdout.strip())
+
def test_enable_fips_install_apt_transport_https(self):
"""enable-fips installs apt-transport-https if needed."""
self.apt_method_https.unlink()

0 comments on commit f3b6bfa

Please sign in to comment.