mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
letsencrypt: Fix tests requiring sudo
Closes #1084 Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
cf62269bf7
commit
29ca31fae2
@ -18,21 +18,27 @@
|
|||||||
Tests for letsencrypt module.
|
Tests for letsencrypt module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from .. import on_domain_added, on_domain_removed
|
from .. import on_domain_added, on_domain_removed
|
||||||
|
|
||||||
|
euid = os.geteuid()
|
||||||
|
|
||||||
|
|
||||||
class TestDomainNameChanges(unittest.TestCase):
|
class TestDomainNameChanges(unittest.TestCase):
|
||||||
"""Test for automatically obtaining and revoking Let's Encrypt certs"""
|
"""Test for automatically obtaining and revoking Let's Encrypt certs"""
|
||||||
|
|
||||||
|
@unittest.skipUnless(euid == 0, 'Needs to be root')
|
||||||
def test_add_onion_domain(self):
|
def test_add_onion_domain(self):
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
on_domain_added('test', 'hiddenservice', 'ddddd.onion'))
|
on_domain_added('test', 'hiddenservice', 'ddddd.onion'))
|
||||||
|
|
||||||
|
@unittest.skipUnless(euid == 0, 'Needs to be root')
|
||||||
def test_add_valid_domain(self):
|
def test_add_valid_domain(self):
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
on_domain_added('test', 'domainname', 'subdomain.domain.tld'))
|
on_domain_added('test', 'domainname', 'subdomain.domain.tld'))
|
||||||
|
|
||||||
|
@unittest.skipUnless(euid == 0, 'Needs to be root')
|
||||||
def test_remove_domain(self):
|
def test_remove_domain(self):
|
||||||
self.assertTrue(on_domain_removed('test', '', 'somedomain.tld'))
|
self.assertTrue(on_domain_removed('test', '', 'somedomain.tld'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user