img-proof (IPA) provides a command line utility to test images in the Public Cloud

Overview

Continuous testing & Linting Documentation Status Py Versions License

img-proof

overview

img-proof (IPA) provides a command line utility to test images in the Public Cloud (AWS, Azure, GCE, etc.).

With img-proof you can now test custom images in a cloud framework agnostic way with one tool and one API. In the first release, img-proof supports the openSUSE and SLES distributions. It also supports the three largest cloud frameworks (AWS, Azure and GCE). However, it is intended to be distribution agnostic and framework transparent so both are easily extensible.

For each distribution there are specific synchronization points that must be provided. These currently include soft reboot and system update. The synch points not only test functionality but also act as dividers to separate distinct sections of a test suite. For example you can run a test to ensure the proper repos exist before and after a system update. The system update synch point will guarantee the order of tests. Speaking of tests, if you're already familiar with Pytest conventions there's no need to learn a whole new unit testing framework. img-proof is written in Python and leverages the Pytest framework through Testinfra.

Installation

To install the package use the following commands as root:

$ zypper ar http://download.opensuse.org/repositories/Cloud:/Tools/<distribution>
$ zypper refresh
$ zypper in python3-img-proof

Requirements

  • boto3
  • apache-libcloud
  • azure-common
  • azure-mgmt-compute
  • azure-mgmt-network
  • azure-mgmt-resource
  • Click
  • paramiko
  • pytest
  • PyYaml
  • testinfra
  • oci

Docs

Tests

img-proof uses the Testinfra package for writing unit tests. Testinfra leverages Pytest and provides modules such as Package, Process and Service to test the state of images. See the Testinfra Docs for more information on writing infrastructure tests.

img-proof currently passes the Pytest option -x (stop on first failure) through as --early-exit. If there's an interest or need for any other options/args please submit an issue to Github.

CLI Overview

The CLI provides multiple subcommands to initiate image testing:

  • img-proof test

    Test image in the given framework using the supplied test files.

  • img-proof results

    Invokes the default show subcommand img-proof results show 1.

  • img-proof results clear

    Clear the results from the history file.

  • img-proof results delete

    Delete the specified history item from the history log.

  • img-proof results list`

    Display list of results history.

  • img-proof results show

    Display the results or log file for a history item.

  • img-proof list

    Print a list of test files or test cases.

Issues/Enhancements

Please submit issues and requests to Github.

Contributing

Contributions to ipa are welcome and encouraged. See CONTRIBUTING for info on getting started.

License

Copyright (c) 2018 SUSE LLC.

Distributed under the terms of GPL-3.0+ license, see LICENSE for details.

Comments
  • Add exclude parameter

    Add exclude parameter

    Adds a new --exclude parameter to img-proof test, that allows to pass a comma-separated list of test expressions to skip during a test run.

    This allows for using of common patterns e.g. test_sles without running certain tests. Before one needed to state an explicit list of test runs with the risk of not including new test runs as they are included into img-proof.

    Stale 
    opened by grisu48 12
  • Need `--resource-group` parameter with `--running-instance-id`

    Need `--resource-group` parameter with `--running-instance-id`

    Currently we do the assumption, that the resource group name is equal to the name of the VM. This isn't always the case.

    1. We should add a parameter --resource-group for azure.
    2. We could allow using full instance id's like /subscriptions/c011786b-59d7-4817-880c-7cd8a6ca4b19/resourceGroups/openqa-suse-de-1ec3f5a05b7c0712/providers/Microsoft.Compute/virtualMachines/openqa-suse-de-1ec3f5a05b7c0712 and parse resource-group and instance name from it.
    opened by cfconrad 7
  • EC2 SSH key use user data

    EC2 SSH key use user data

    Use user data to add SSH public key to instance on EC2 launch when ssh key name is not provided.

    • SSH public key is generated based on private key file.
    • ssh_key_name arg is optional but takes precedence if provided.
    opened by smarlowucf 7
  • Handle the API change in cloud-regionsrv-client

    Handle the API change in cloud-regionsrv-client

    • The cloud-regionsrv-client API for the is_registered() function has changed from expecting an object to expecting a string. Change the test implementation to handle both cases.
    opened by rjschwei 5
  • traceback generated during mash run

    traceback generated during mash run

    ERROR 2019-05-20 20:14:03,773 TestingService Pass[1]: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/ipa/ipa_cloud.py", line 636, in test_im age client File "/usr/lib/python3.6/site-packages/ipa/ipa_utils.py", line 262, in get_hos t_key_fingerprint client.get_transport().get_remote_server_key().get_fingerprint() File "/usr/lib/python3.6/site-packages/paramiko/transport.py", line 761, in ge t_remote_server_key raise SSHException("No existing session") paramiko.ssh_exception.SSHException: No existing session

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/mash/services/testing/ipa_helper.py", l ine 95, in ipa_test timeout=ipa_timeout File "/usr/lib/python3.6/site-packages/ipa/ipa_controller.py", line 131, in te st_image return cloud.test_image() File "/usr/lib/python3.6/site-packages/ipa/ipa_cloud.py", line 644, in test_im age 'An error occurred retrieving host key: %s' % error ipa.ipa_exceptions.IpaCloudException: An error occurred retrieving host key: No existing session

    mash job id: 4f8c81dd-cfd4-4697-be5f-1777c6c4b220

    opened by rjschwei 4
  • repo test

    repo test

    The suse specific repository test should provide more details. With the switch to the modules and the various flavors of repositories, source, debuginfo etc. it has pretty much become impossible to manually verify registration success. IPA provides the necessary functionality. However, the registration test has a pass/fail status leaving the user/verifyer with the original problem. the test shold produce a diff list in the results if the repo data does not match the expected content. This should hopefully allow the person verifying the test results an opportunity to understand the failure and address it.

    opened by rjschwei 4
  • Apache libcloud

    Apache libcloud

    Consider migrating EC2 and Azure to Apache Libcloud to minimize dependencies and make providers more uniform.

    This would also make adding new providers much easier so long as they are supported by libcloud.

    Todo:

    • [x] GCE
    • [x] EC2
    • [ ] Azure
    enhancement 
    opened by smarlowucf 4
  • Fix wrong exclude type

    Fix wrong exclude type

    Allows the exclude parameter to be any iterable and string. This fixes a regression in which passing any exclude parameter crashed the program.

    Fixes https://github.com/SUSE-Enceladus/img-proof/issues/345

    opened by grisu48 3
  • Add grow root test

    Add grow root test

    Set root disk to non-default size of 50GB except in OCI (TBD). And test confirms that the filesystem properly expands.

    I could not find info in OCI SDK docs about changing root disk parameters when launching instances. Issue opened upstream.

    opened by smarlowucf 3
  • Add Red Hat family distro module and Fedora distro module

    Add Red Hat family distro module and Fedora distro module

    This change adds support for testing Red Hat based distributions, and adds a Fedora module for testing Fedora cloud images.

    This PR is the beginning of investigating using img_proof for automatically testing Fedora Cloud Edition images by the Fedora Cloud SIG.

    (cc: @dustymabe, @major)

    opened by Conan-Kudo 3
  • treat uuid always lowercase

    treat uuid always lowercase

    Since https://github.com/torvalds/linux/commit/712ff25450bd01366301eef81c33e865d901e7b7 the uuid is created with lowercase letters.

    I see failing test with SLE15-SP1: https://openqa.suse.de/tests/2340648#step/EC2_test_sles_ec2_uuid_py__test_sles_ec2_uuid/1

    opened by cfconrad 3
  • configparser>=3.5.0b1 distribution was not found and is required by oci

    configparser>=3.5.0b1 distribution was not found and is required by oci

    Hi,

    when installing img-proof from the http://download.opensuse.org/repositories/Cloud:/Tools/openSUSE_Leap_15.2/ repository, I get the following error message:

    [email protected]:~> img-proof --version
    Traceback (most recent call last):
      File "/usr/bin/img-proof", line 6, in <module>
        from pkg_resources import load_entry_point
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3123, in <module>
        @_call_aside
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3107, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3136, in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 578, in _build_master
        ws.require(__requires__)
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 895, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 781, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'configparser>=3.5.0b1' distribution was not found and is required by oci
    

    I followed the installation procedure from the README.md

    zypper ar http://download.opensuse.org/repositories/Cloud:/Tools/openSUSE_Leap_15.2/ PC_Tools_15_2
    zypper ref
    zypper in python3-img-proof
    
    opened by grisu48 1
  • Drop extension from test names

    Drop extension from test names

    If a user supplies the .py extension in a test description yaml file or in command line it would be helpful for img-proof to drop this by default prior to doing the test search. Or it would be nice to provide more info with the test not found message to make it clear that the extension is not needed.

    enhancement 
    opened by smarlowucf 0
  • SLES test suite should wait for initialization

    SLES test suite should wait for initialization

    Currently when running the SLES test suite on BYOS images we might reboot to soon. Prior to reboot img-proof should wait for the initialization code to finish:

    • In Azure this is waagent
    • In EC2 and OCI it's cloud-init-final
    • In GCE it's google-startup-scripts
    enhancement 
    opened by smarlowucf 0
  • Allow reading of results from an archive

    Allow reading of results from an archive

    If ipa handles listing results from an archive then the user should just give us the archive name, i.e.

    ipa results list --archive $PATH_TO_MY_ARCHIVE ipa results show 5 --archive $PATH_TO_MY_ARCHIVE

    And ipa should just extract the file on the fly to get the results.

    Question is should this be to a temp dir which is deleted after the command or should it be cached somehow for subsequent calls?

    enhancement 
    opened by smarlowucf 0
  • Add Config setup endpoint

    Add Config setup endpoint

    It would be a nice enhancement to have a config setup option in CLI. This would help the user setup the ipa config and/or all config files with info for testing. Since a user may not have config setup for ec2utils, azurectl or Google.

    ipa setup

    Series of prompts requesting config data.

    enhancement 
    opened by smarlowucf 0
Releases(v7.0.0)
Basic python tools to generate shellcode runner in vba

vba_bin_runner Basic python tools to generate shellcode runner in vba. The stub use ZwAllocateVirtualMemory to allocate memory, RtlMoveMemory to write

4 Aug 24, 2021
Python remote shell.

Python remote shell.

Steven 9 Oct 17, 2022
texel - Command line interface for reading spreadsheets inside terminal

texel - Command line interface for reading spreadsheets inside terminal. Sometimes, you have to deal with spreadsheets. Those are sad times. Fortunate

128 Dec 19, 2022
Simple Python Library to display text with color in Python Terminal

pyTextColor v1.0 Introduction pyTextColor is a simple Python Library to display colorful outputs in Terminal, etc. Note: Your Terminal or any software

Siddhesh Chavan 1 Jan 23, 2022
Text based command line webcam photobooth app

Skunkbooth Why See it in action Usage Installation Run Media location Contributing Install Poetry Clone the repo Activate poetry shell Install dev dep

David Yang 45 Dec 26, 2022
ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal

ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many forums the need of a similar utility for privacy-aware

Piña Colada 2.5k Dec 25, 2022
Several tools that can be added to your `PATH` to make your life easier.

CK-CLI Tools Several tools that can be added to your PATH to make your life easier. prettypath Prints the $PATH variable in a human-readable way. It a

Christopher Kumm 2 Apr 21, 2022
Format click help output nicely with rich.

rich-click Format click help output nicely with Rich. Click is a "Python package for creating beautiful command line interfaces". Rich is a "Python li

Phil Ewels 333 Jan 02, 2023
Find your broken links, so users don't.

PyAnchor Dead links are an annoyance for websites with an extensive amount of content. A side from the negative impact on SEO, dead links are an annoy

Ricky White 61 Dec 14, 2022
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

Nathan Reed 15 Sep 22, 2022
Python-based implementation and comparison of strategies to guess words at Wordle

Solver and comparison of strategies for Wordle Motivation The goal of this repository is to compare, in terms of performance, strategies that minimize

Ignacio L. Ibarra 4 Feb 16, 2022
Unconventional ways to save an Image

Unexpected Image Saves Unconventional ways to save an image 😄 Have you ever been bored by the same old .png, .jpg, .jpeg, .gif and all other image ex

Eric Mendes 15 Nov 06, 2022
The WalletsNet CLI helps you connect to WalletsNet

WalletsNet CLI The WalletsNet CLI helps you connect to WalletsNet. With the CLI, you can: Trigger webhook events or resend events for easy testing Tai

WalletsClub 8 Dec 22, 2021
Shortcut-Maker - It is a tool that can be set to run any tool with a single command

Shortcut-Maker It is a tool that can be set to run any tool with a single command Coded by Dave Smith(Owner of Sl Cyber Warriors) Command list 👇 pkg

Dave Smith 10 Sep 14, 2022
Get Air Quality Index for your city/country 😷

Air Quality Index CLI Get Air Quality index for your City. Installation $ pip install air-quality-cli Contents Air Quality Index CLI Installation Cont

Yankee 40 Oct 21, 2022
lfb (light file browser) is a terminal file browser

lfb (light file browser) is a terminal file browser. The whole program is a mess as of now. In the feature I will remove the need for external dependencies, tidy up the code, make an actual readme, a

2 Apr 09, 2022
A CLI tool for using GLIDE to generate images from text.

Text-Glided-Diffusion Installation First clone this repository: git clone https://github.com/afiaka87/text-glided-diffusion.git cd text-glided-diffusi

Clay Mullis 68 Dec 30, 2022
A command line connect 4 game against a minimax agent.

A command line connect 4 game against a minimax agent.

1 Oct 17, 2021
CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc)

dc6006l - CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc) What is this? FNIRSI DC6006L is a programmable DC power supply that is quite c

Taisuke Yamada 7 Sep 25, 2022
CryptoCo-py is a Python CLI application that uses CoinGecko API to allow the user to query cryptocurrency information by typing simple commands.

CryptoCo-py is a Python CLI application that uses CoinGecko API to allow the user to query cryptocurrency information by typing simple com

1 Jan 10, 2022