Skip to content

Conversation

@spetrosi
Copy link
Contributor

@spetrosi spetrosi commented Feb 6, 2025

No description provided.

@spetrosi
Copy link
Contributor Author

spetrosi commented Feb 6, 2025

@richm do you know if specifying two NICs can be done in tests/provision.fmf without breaking anything? For now, I am simply adding a condition for the network role.

@spetrosi spetrosi changed the title tft: For network, add two NICs ci: Add two NICs for test purposes Feb 6, 2025
{%- endraw +%}
{%- if inventory_hostname == "network" %}
{%- raw %}
tmt_hardware: '{ "memory": ">= ${{ needs.prepare_vars.outputs.memory }} MB", "network": [{"type": "eth"},{"type": "eth"}]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok for now - but it would be nice if there were some sort of configuration file (like provision.fmf) that would be in the role code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've asked about this above. This file exists but I cannot find syntax to populate it. Workflow reads memory from this file already, it would be ideal to read nics from it too. Do you know if specifying two NICs can be done in tests/provision.fmf without breaking anything?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example from the timesync role - https://github.com/linux-system-roles/timesync/blob/main/tests/provision.fmf

standard-inventory-qcow2:
  qemu:
    net_nic:
      # Use qemu-system-x86_64 -net nic,model=help for a list of available devices.
      model: e1000

which seems a different use case - so I don't think we can use provision.fmf for this.

But that is ok - we don't need to worry about this now - but at some point in the future if we need to add something similar to another role, we may need to use some sort of config file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we could use provision.fmf for this, but I think it would be a bad idea - here is the only place where the code is used in standard-inventory-qcow2:

    param_net_nic_model = str(fmf_get(['qemu', 'net_nic', 'model'], 'virtio'))

so we could do something like this which would not break standard-inventory-qcow2

standard-inventory-qcow2:
  qemu:
    net_nic:
      devices: [eth, eth]

but it's bad to override the format - the format is supposed to map directly to qemu command line parameters and values https://pagure.io/fork/fbo/standard-test-roles/tree/master - Flexible Metadata Format for default provisioner(s)

Supported parameters
standard-inventory-qcow2

    qemu.m - RAM size in megabytes. Optionally, a suffix of M or G.
    qemu.net_nic.model - Use qemu-system-x86_64 -net nic,model=help for a list of available devices.
    drive - has to contain dict of additional drive(s)
    drive.size - allows to specify additional drive with size in bytes (default size: 2G)
    drive.path - allows to specify additional drive with custom path to its backing file (default path: /tmp)

You can open a RFE ticket to extend supported parameters according to https://qemu.weilnetz.de/doc/qemu-doc.html

@spetrosi
Copy link
Contributor Author

spetrosi commented Feb 6, 2025

Agreed, we can add a file similar to provision.fmf to include hardware info for testing farm.
Network PR: linux-system-roles/network#762

@spetrosi spetrosi merged commit 65da475 into linux-system-roles:main Feb 6, 2025
@spetrosi
Copy link
Contributor Author

spetrosi commented Feb 6, 2025

I forgot a closing curly bracket though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants