def test_queue_voq_counters_json(self):
        runner = CliRunner()
        result = runner.invoke(
            show.cli.commands["queue"].commands["counters"],
            ["--voq", "--json"]
        )
        assert result.exit_code == 0
        print(result.output)
        json_output = json.loads(result.output)

        # remove "time" from the output
        for _, v in json_output.items():
            del v["time"]
        print(json_dump(json_output))
        print(show_queue_voq_counters_json)
        assert json_dump(json_output) == show_queue_voq_counters_json
示例#2
0
def summary(json):
    """Show hardware platform information"""

    hw_info_dict = {}
    hw_info_dict = get_hw_info_dict()

    if json:
        click.echo(clicommon.json_dump(hw_info_dict))
    else:
        click.echo("Platform: {}".format(hw_info_dict['platform']))
        click.echo("HwSKU: {}".format(hw_info_dict['hwsku']))
        click.echo("ASIC: {}".format(hw_info_dict['asic_type']))
        click.echo("ASIC Count: {}".format(hw_info_dict['asic_count']))
def summary(json):
    """Show hardware platform information"""
    platform_info = device_info.get_platform_info()
    chassis_info = get_chassis_info()

    if json:
        click.echo(clicommon.json_dump({**platform_info, **chassis_info}))
    else:
        click.echo("Platform: {}".format(platform_info['platform']))
        click.echo("HwSKU: {}".format(platform_info['hwsku']))
        click.echo("ASIC: {}".format(platform_info['asic_type']))
        click.echo("ASIC Count: {}".format(platform_info['asic_count']))
        click.echo("Serial Number: {}".format(chassis_info['serial']))
        click.echo("Model Number: {}".format(chassis_info['model']))
        click.echo("Hardware Revision: {}".format(chassis_info['revision']))