[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] branch master updated: added license headers, G
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] branch master updated: added license headers, GNU coding style guidelines |
Date: |
Fri, 25 Jan 2019 17:25:26 +0100 |
This is an automated email from the git hooks/post-receive script.
rexxnor pushed a commit to branch master
in repository ascension.
The following commit(s) were added to refs/heads/master by this push:
new 1b658eb added license headers, GNU coding style guidelines
1b658eb is described below
commit 1b658eb4cfbd21235fa8f0b9d8d4b4fafd83978d
Author: rexxnor <address@hidden>
AuthorDate: Fri Jan 25 17:19:02 2019 +0100
added license headers, GNU coding style guidelines
---
.gitignore | 1 +
README.md => README | 0
ascension/ascension.py | 34 +++++++++++++----
ascension/test/test_ascension_simple.sh | 7 +++-
ascension/test/test_namestore_multiple.sh | 25 +++---------
ascension/test/test_unit_ascension.py | 63 +++++++++++++------------------
requirements.txt | 1 +
setup.py | 20 +++++++++-
8 files changed, 84 insertions(+), 67 deletions(-)
diff --git a/.gitignore b/.gitignore
index 23ff70e..4c5f90e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,3 +96,4 @@ ENV/
# mkdocs documentation
/site
.idea/
+managed-keys.bind.jnl
diff --git a/README.md b/README
similarity index 100%
rename from README.md
rename to README
diff --git a/ascension/ascension.py b/ascension/ascension.py
index cd4a549..c937553 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -1,13 +1,31 @@
#!/usr/bin/env python3
-"""Ascension
-
+# This file is part of Ascension.
+# Copyright (C) 2019 GNUnet e.V.
+#
+# Ascension is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License,
+# or (at your option) any later version.
+#
+# Ascension is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# SPDX-License-Identifier: AGPL3.0-or-later
+#
+# Author rexxnor
+"""
Usage:
- ascension.py <domain> [-d]
- ascension.py <domain> -p <port> [-d]
- ascension.py <domain> -ns <transferns> [-d]
- ascension.py <domain> -ns <transferns> -p <port> [-d]
- ascension.py -h | --help
- ascension.py -v | --version
+ ascension <domain> [-d]
+ ascension <domain> -p <port> [-d]
+ ascension <domain> -ns <transferns> [-d]
+ ascension <domain> -ns <transferns> -p <port> [-d]
+ ascension -h | --help
+ ascension -v | --version
Options:
<port> Port for zone transfer
diff --git a/ascension/test/test_ascension_simple.sh
b/ascension/test/test_ascension_simple.sh
index 9367a3e..0c48296 100644
--- a/ascension/test/test_ascension_simple.sh
+++ b/ascension/test/test_ascension_simple.sh
@@ -1,9 +1,14 @@
#!/bin/bash
-# Author: rexxnor
+# Copyright (C) 2019 rexxnor
+# License AGPLv3+: GNU AGPL version 3 or later
<https://www.gnu.org/licenses/agpl.html>
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+#
# Returns 1 on basic error
# Returns 2 on explicit test case errors
# Returns 3 on implicit test case errors
+
# Shutdown named
function cleanup {
pkill named
diff --git a/ascension/test/test_namestore_multiple.sh
b/ascension/test/test_namestore_multiple.sh
index 72862a6..9e971cd 100644
--- a/ascension/test/test_namestore_multiple.sh
+++ b/ascension/test/test_namestore_multiple.sh
@@ -1,27 +1,12 @@
#!/bin/bash
+# Copyright (C) 2019 rexxnor
+# License AGPLv3+: GNU AGPL version 3 or later
<https://www.gnu.org/licenses/agpl.html>
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
# This file is in the public domain.
-#trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-#
-#LOCATION=$(command -v gnunet-config)
-#if [ -z "$LOCATION" ]
-#then
-# LOCATION="gnunet-config"
-#fi
-#$LOCATION --version 1> /dev/null
-#if test $? != 0
-#then
-# echo "GNUnet command line tools cannot be found, check environmental
variables PATH and GNUNET_PREFIX"
-# exit 77
-#fi
-#
-#rm -rf "$(gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f)"
-#command -v timeout &> /dev/null && DO_TIMEOUT="timeout 30"
-#
+
## VARS
MYEGO=myego
-#command -v timeout &> /dev/null && DO_TIMEOUT="timeout 15"
-#
-#gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C myego
# HELPERS
diff --git a/ascension/test/test_unit_ascension.py
b/ascension/test/test_unit_ascension.py
index d9a59fa..a6620f0 100644
--- a/ascension/test/test_unit_ascension.py
+++ b/ascension/test/test_unit_ascension.py
@@ -1,15 +1,31 @@
#!/usr/bin/env python3
"""
-Unittests of ascension
+This file is part of Ascension.
+Copyright (C) 2019 GNUnet e.V.
+
+Ascension is free software: you can redistribute it and/or modify it
+under the terms of the GNU Affero General Public License as published
+by the Free Software Foundation, either version 3 of the License,
+or (at your option) any later version.
+
+Ascension is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+SPDX-License-Identifier: AGPL3.0-or-later
+
+Author rexxnor
"""
import subprocess
import unittest
-import mock
from unittest import TestCase
from ascension import ascension
-
class TestAscender(TestCase):
"""
Short Unit Tests for WebArchiver
@@ -19,51 +35,24 @@ class TestAscender(TestCase):
"""
Prepare data for tests
"""
- cls.ascension = ascension.Ascender(["pretty.fantasy"])
+ cls.ascender = ascension.Ascender("notsopretty.fantasy",
+ transferns="ns1.example.com",
+ port=8000)
def test_constructor(self):
"""
Tests constructor
"""
- self.assertEqual(["pretty.fantasy"], self.ascension.domainlist)
-
- def test_get_lowest_domain_part(self):
- """
- Tests constructor
- """
- self.assertEqual("pretty", self.ascension.get_lowest_domain_part(
- self.ascension.domainlist[0]))
-
- def test_bootstrap_zones(self):
- """
- Tests bootstrapping of zones with mocked subprocess commands
- """
- self.ascension.bootstrap_zones()
- # using mocked subprocesses to prevent inconsistent status
- mocked_ident = mock.create_autospec(subprocess.check_output,
return_value='fantasy PKEY')
- self.assertIn('fantasy', mocked_ident(['gnunet-identity', '-d']))
- mocked_lookup = mock.create_autospec(subprocess.check_output,
return_value='Got:')
- self.assertIn('Got', mocked_lookup(['gnunet-gns', '-t', 'PKEY', '-u',
'pretty.fantasy']))
- mocked_failed_lookup = mock.create_autospec(subprocess.check_output,
return_value=3)
- self.assertIs(3, mocked_failed_lookup(['gnunet-gns', '-t', 'PKEY',
'-u', 'pretty.pretty.fantasy']))
-
- def test_initial_zone_transfer(self):
- """
- Tests different ways of zone transfer not working
- """
- self.ascension.initial_zone_transfer()
-
- # Needs to be done via mock stuff or expect weird stuff
- #self.assertRaises(dns.resolver.NoAnswer,
self.ascension.initial_zone_transfer())
- #self.assertRaises(dns.resolver.NoAnswer,
self.ascension2.initial_zone_transfer())
+ self.assertEqual("ns1.example.com", self.ascender.transferns)
+ self.assertEqual(8000, self.ascender.port)
@classmethod
def tearDownClass(cls):
"""
Removes all zones and cleans up testing environment
"""
- subprocess.run(['gnunet-identity', '-D', 'pretty'])
- subprocess.run(['gnunet-identity', '-D', 'fantasy'])
+ subprocess.run(['gnunet-identity', '-D', 'pretty.fantasy'])
+ subprocess.run(['gnunet-identity', '-D', 'notsopretty.fantasy'])
if __name__ == "__main__":
unittest.main()
diff --git a/requirements.txt b/requirements.txt
index c3ad18c..62447a4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
+# This file is in the public domain
coverage==4.5.2
daemon==1.2
daemonize==2.5.0
diff --git a/setup.py b/setup.py
index 394b172..6d33e49 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,24 @@
#!/usr/bin/env python3
"""
-Setup file for installing the package
+This file is part of Ascension.
+Copyright (C) 2019 GNUnet e.V.
+
+Ascension is free software: you can redistribute it and/or modify it
+under the terms of the GNU Affero General Public License as published
+by the Free Software Foundation, either version 3 of the License,
+or (at your option) any later version.
+
+Ascension is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+SPDX-License-Identifier: AGPL3.0-or-later
+
+Author rexxnor
"""
import setuptools
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [ascension] branch master updated: added license headers, GNU coding style guidelines,
gnunet <=