suite: externalInterface name test
templates:
  - common.yaml
release:
  name: release-name
tests:
  - it: should generate correct name NetworkAttachmentDefinition
    set:
      # Simulate middleware injection
      ixExternalInterfacesConfiguration:
        - '{"cniVersion": "0.3.1", "name": "ix-release-name-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}'
        - '{"cniVersion": "0.3.1", "name": "ix-release-name-0", "type": "macvlan", "master": "ens4s0", "ipam": {"type": "dhcp"}}'
      ixExternalInterfacesConfigurationNames:
        - ix-release-name-0
        - ix-release-name-1
      scaleExternalInterface:
        - hostInterface: enp0s3
          ipam:
            type: dhcp
        - hostInterface: enp0s4
          ipam:
            type: dhcp
    asserts:
      - documentIndex: &networkDoc 0
        isKind:
          of: NetworkAttachmentDefinition
      - documentIndex: *networkDoc
        isAPIVersion:
          of: k8s.cni.cncf.io/v1
      - documentIndex: *networkDoc
        equal:
          path: metadata.name
          value: ix-release-name-0
      - documentIndex: &otherNetworkDoc 1
        isKind:
          of: NetworkAttachmentDefinition
      - documentIndex: *otherNetworkDoc
        isAPIVersion:
          of: k8s.cni.cncf.io/v1
      - documentIndex: *otherNetworkDoc
        equal:
          path: metadata.name
          value: ix-release-name-1
