+ @staticmethod
+ def get_iperf3_command(iperf3_attributes):
+ """Construct the iperf3 command using the specified attributes.
+
+ :param iperf3_attributes: iperf3 test program attributes.
+ :type iperf3_attributes: dict
+ :returns: Command line components of the iperf3 command
+ 'env_vars' - environment variables
+ 'name' - program name
+ 'args' - command arguments.
+ :rtype: dict
+ """
+ iperf3_cmd = {}
+ iperf3_cmd[u"env_vars"] = f"VCL_CONFIG={Constants.REMOTE_FW_DIR}/" \
+ f"{Constants.RESOURCES_TPL_VCL}/" \
+ f"{iperf3_attributes[u'vcl_config']}"
+ if iperf3_attributes[u"ld_preload"]:
+ iperf3_cmd[u"env_vars"] += \
+ f" LD_PRELOAD={Constants.VCL_LDPRELOAD_LIBRARY}"
+ if iperf3_attributes[u'transparent_tls']:
+ iperf3_cmd[u"env_vars"] += u" LDP_ENV_TLS_TRANS=1"
+
+ json_results = u" --json" if iperf3_attributes[u'json'] else u""
+ ip_address = f" {iperf3_attributes[u'ip_address']}" if u"ip_address" \
+ in iperf3_attributes else u""
+ iperf3_cmd[u"name"] = u"iperf3"
+ # TODO: Use OptionString library.
+ iperf3_cmd[u"args"] = f"--{iperf3_attributes[u'role']}{ip_address} " \
+ f"--interval 0{json_results} " \
+ f"--version{iperf3_attributes[u'ip_version']}"
+
+ if iperf3_attributes[u"role"] == u"server":
+ iperf3_cmd[u"args"] += u" --one-off"
+ else:
+ iperf3_cmd[u"args"] += u" --get-server-output"
+ if u"parallel" in iperf3_attributes:
+ iperf3_cmd[u"args"] += \
+ f" --parallel {iperf3_attributes[u'parallel']}"
+ if u"time" in iperf3_attributes:
+ iperf3_cmd[u"args"] += \
+ f" --time {iperf3_attributes[u'time']}"
+ if iperf3_attributes[u"udp"]:
+ iperf3_cmd[u"args"] += u" --udp"
+ iperf3_cmd[u"args"] += \
+ f" --bandwidth {iperf3_attributes[u'bandwidth']}"
+ if iperf3_attributes[u"length"] > 0:
+ iperf3_cmd[u"args"] += \
+ f" --length {iperf3_attributes[u'length']}"
+ return iperf3_cmd
+