def test_version(self):
     runner = CliRunner()
     result = runner.invoke(cli, ['--version'])
     assert result.exit_code == 0
     assert result.output == 'icetrust, version ' + IcetrustUtils.get_version(
     ) + '\n'
示例#2
0
from setuptools import find_packages, setup
from icetrust.utils import IcetrustUtils

with open("README.md", "r") as fh:
    long_description = fh.read()

setup(
    name='icetrust',
    version=IcetrustUtils.get_version(),
    description=
    'A tool for verification of software downloads using checksums and PGP.',
    long_description=long_description,
    long_description_content_type="text/markdown",
    url='https://github.com/nightwatchcybersecurity/icetrust',
    author='Nightwatch Cybersecurity',
    author_email='*****@*****.**',
    license='Apache',
    packages=find_packages(
        exclude=["scripts.*", "scripts", "tests.*", "tests"]),
    include_package_data=True,
    install_requires=open('requirements.txt').read().splitlines(),
    entry_points={'console_scripts': ['icetrust = icetrust.cli:cli']},
    classifiers=[
        'Environment :: Console',
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
示例#3
0
 def test_get_version_format_valid(self):
     pattern = re.compile(r'^(\d+\.)?(\d+\.)?(\*|\d+)$')
     assert pattern.match(IcetrustUtils.get_version()) is not None
示例#4
0
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
import os, shutil, sys, tempfile

import click
from icetrust.utils import DEFAULT_HASH_ALGORITHM, IcetrustUtils
from icetrust.utils_canary import FILENAME_FILE1, FILENAME_FILE2, FILENAME_CHECKSUM, FILENAME_SIGNATURE,\
    IcetrustCanaryUtils, VerificationModes


@click.version_option(version=IcetrustUtils.get_version(), prog_name='icetrust')
@click.group()
def cli():
    """
    icetrust - A tool for verification of software downloads using checksums and/or PGP.

    Copyright (c) 2021 Nightwatch Cybersecurity.
    Source code: https://github.com/nightwatchcybersecurity/icetrust
    """
    # TODO: Add input validation
    # TODO: Move private code into a separate module


def _process_result(verification_result):
    """Process verification results and exit"""
    if verification_result: