Debugging the Redfish API is relatively easy since JSON is at least partially human-readable (programmer-readable maybe? ;).
Inspect the Redfish API responses using curl
is relatively simple. We start
by running this:
package compress; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.file.FileVisitResult; |
- name: Redfish test | |
gather_facts: false | |
connection: local | |
hosts: localhost | |
tasks: | |
- name: Runy dummy redfish task | |
redfish_system: | |
id: /redfish/v1/Systems/1 | |
base_url: "http://localhost:8000" | |
username: demo |
Failures: | |
1) ManageIQ::Providers::Lenovo::PhysicalInfraManager::Refresher will perform a full refresh with ems1 | |
Failure/Error: EmsRefresh.refresh(ems) | |
ActiveRecord::HasManyThroughSourceAssociationNotFoundError: | |
Could not find the source association(s) :management_devices in model Hardware. Try 'has_many :physical_chassis_management_devices, :through => :physical_chassis_hardwares, :source => <name>'. Is it one of vm_or_template, vm, miq_template, host, computer_system, physical_switch, networks, firmwares, disks, hard_disks, floppies, cdroms, partitions, volumes, guest_devices, storage_adapters, nics, ports, physical_ports, or connected_physical_switches? | |
# /home/tadej/xlab/wwt/manageiq/app/models/manageiq/providers/inventory/persister.rb:29:in `persist!' | |
# /home/tadej/xlab/wwt/manageiq/app/models/manageiq/providers/base_manager/refresher.rb:162:in `save_inventory' | |
# /home/tadej/xlab/wwt/manageiq/app/models/manageiq/providers/base_manager/refresher.rb:96:in `block in r |
$ ansible-test units tests/unit/test_x.py | |
... | |
========================================== FAILURES =========================================== | |
________________________________________ test_my_stuff ________________________________________ | |
[gw0] linux -- Python 3.7.6 /tmp/python-8s1dwmns-ansible/python | |
def test_my_stuff(): | |
> assert dict(a=3) == dict(b=2) | |
E AssertionError | |
tests/unit/test_x.py:2: AssertionError |
--- | |
- name: Test | |
hosts: localhost | |
gather_facts: false | |
tasks: | |
- name: Dummy data | |
shell: echo -e "1 a\n1 b\n1 c\n" | |
register: result |
#!/bin/bash | |
rm -rf x.git y | |
git init --bare x.git | |
git clone x.git y | |
cd y | |
echo bla > bla.txt |
#!/bin/bash | |
mkdir vmware && cd vmware | |
mkdir -p collections/ansible_collections/community | |
git clone \ | |
--depth=1 \ | |
https://github.com/ansible-collections/vmware.git \ | |
collections/ansible_collections/community/vmware |
# -*- coding: utf-8 -*- | |
# (c) 2020, Ansible Project | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
from __future__ import absolute_import, division, print_function | |
__metaclass__ = type | |
import pytest |
$ ansible-test units --python 3.8 tests/unit/modules/test_asset.py | |
WARNING: PyYAML will be slow due to installation without libyaml support for interpreter: /home/tadej/xlab/sensu/venvt/bin/python | |
Unit test with Python 3.8 | |
================================================= test session starts ================================================= | |
platform linux -- Python 3.8.3, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 | |
rootdir: /home/tadej/xlab/sensu/ansible_collections/sensu/sensu_go/tests/unit/modules, configfile: ../../../../../../venvt/lib64/python3.8/site-packages/ansible_test/_data/pytest.ini | |
plugins: xdist-1.34.0, forked-1.3.0, mock-3.2.0 | |
gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0] / gw4 [0] / gw5 [0] / gw6 [0] / gw7 [0] | |
======================================================= ERRORS ======================================================== |