def test_update_export_no_export_options_difference(file_storage_client, update_and_wait_patch):
    export = get_export()
    export_options = [{"source": "0.0.0.0/0", "require_privileged_source_port": False,
                            "access": "READ_ONLY", "identity_squash": "NONE"}]
    module = get_module(dict({'export_id': 'ocid1.export.aaa', 'export_options': export_options}))
    result = oci_export.update_export(file_storage_client, module, export)
    assert result['changed'] is False
def test_update_export_empty_input_export_options(file_storage_client, update_and_wait_patch):
    export = get_export()
    export_options = []
    module = get_module(dict({'export_id': 'ocid1.export.aaa', 'export_options': export_options}))
    update_and_wait_patch.return_value = {
        'export': to_dict(export), 'changed': True}
    result = oci_export.update_export(file_storage_client, module, export)
    assert result['changed'] is True
def test_update_export_different_export_options(file_storage_client, update_and_wait_patch):
    export = get_export()
    export_options = [{"source": "0.0.0.0/0", "require_privileged_source_port": True,
                            "access": "READ_WRITE", "identity_squash": "NONE"}]
    module = get_module(dict({'export_id': 'ocid1.export.aaa', 'export_options': export_options}))
    update_and_wait_patch.return_value = {
        'export': to_dict(export), 'changed': True}
    result = oci_export.update_export(file_storage_client, module, export)
    assert result['changed'] is True
def test_update_export_empty_input_export_options(file_storage_client,
                                                  update_and_wait_patch):
    export = get_export()
    export_options = []
    module = get_module(
        dict({
            "export_id": "ocid1.export.aaa",
            "export_options": export_options
        }))
    update_and_wait_patch.return_value = {
        "export": to_dict(export),
        "changed": True
    }
    result = oci_export.update_export(file_storage_client, module, export)
    assert result["changed"] is True