-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added acceptance test for Dhcp options in various resources that supports it #65
Added acceptance test for Dhcp options in various resources that supports it #65
Conversation
docs/resources/dhcp_fixed_address.md
Outdated
{ | ||
description = "Option 1" | ||
option_code = "234" | ||
option_value = "true" | ||
type = "boolean" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work. description
is not a field part of dhcp_options. Also option_code
is an UUID for the dhcp_option_code object and not just the code. And type
here is either option
or group
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
PlanModifiers: []planmodifier.List{ | ||
listplanmodifier.RequiresReplaceIfConfigured(), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this? This will basically delete the range and recreate it every time the dhcp_options
is modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DHCP option has 2 types, we can either create via option & group. we have added both in function steps and the update was not working when steps were creating DHCP option via option type and then update group type.
docs/resources/dhcp_fixed_address.md
Outdated
resource "bloxone_dhcp_option_code" "option_code" { | ||
code = 250 | ||
name = "example_option_code" | ||
option_space = bloxone_dhcp_option_space.option_space.id | ||
type = "int32" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use a data source to get an existing Option Code (like for ex. option 6). This is a more common scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return strings.Join([]string{testAccOptionSpace("test_option_space", "ip4"), config}, "") | ||
} | ||
|
||
func testAccOptionBasicConfigV6() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func testAccOptionBasicConfigV6() string { | |
func testAccBaseWithV6OptionSpaceAndCode() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return strings.Join([]string{testAccBaseWithIPSpace(), testAccOptionBasicConfig(), config}, "") | ||
} | ||
|
||
func testAccOptionBasicConfig() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func testAccOptionBasicConfig() string { | |
func testAccBaseWithOptionSpaceAndCode() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this function is already used in the basic test, do not reuse it, create another function with the above name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new function created. renamed it
PlanModifiers: []planmodifier.List{ | ||
listplanmodifier.RequiresReplaceIfConfigured(), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one still needs to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -2,6 +2,7 @@ package ipam | |||
|
|||
import ( | |||
"context" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break not needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -2,6 +2,7 @@ package ipam | |||
|
|||
import ( | |||
"context" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break not needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/resources/dhcp_fixed_address.md
Outdated
dhcp_options = [ | ||
{ | ||
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id | ||
option_value = "1.1.1.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change all 1.1.1.1
to 10.0.0.1
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
api_subnet_resource
api_range_resource
api_ip_space_resource
api_fixed_address_resource
api_address_block_resource
api_server
https://infoblox.atlassian.net/browse/DDIA-212