Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#1481) * Adding a new `IPv4OfEmpty` validation method. Tests pass: ``` $ go test ./azurerm/helpers/validate/ -v === RUN TestIP4Address === RUN TestIP4Address/#00 === RUN TestIP4Address/0.0.0.0 === RUN TestIP4Address/1.2.3.no === RUN TestIP4Address/text === RUN TestIP4Address/1.2.3.4 === RUN TestIP4Address/12.34.43.21 === RUN TestIP4Address/100.123.199.0 === RUN TestIP4Address/255.255.255.255 --- PASS: TestIP4Address (0.00s) --- PASS: TestIP4Address/#00 (0.00s) --- PASS: TestIP4Address/0.0.0.0 (0.00s) --- PASS: TestIP4Address/1.2.3.no (0.00s) --- PASS: TestIP4Address/text (0.00s) --- PASS: TestIP4Address/1.2.3.4 (0.00s) --- PASS: TestIP4Address/12.34.43.21 (0.00s) --- PASS: TestIP4Address/100.123.199.0 (0.00s) --- PASS: TestIP4Address/255.255.255.255 (0.00s) === RUN TestIPv4AddressOrEmpty === RUN TestIPv4AddressOrEmpty/#00 === RUN TestIPv4AddressOrEmpty/0.0.0.0 === RUN TestIPv4AddressOrEmpty/1.2.3.no === RUN TestIPv4AddressOrEmpty/text === RUN TestIPv4AddressOrEmpty/1.2.3.4 === RUN TestIPv4AddressOrEmpty/12.34.43.21 === RUN TestIPv4AddressOrEmpty/100.123.199.0 === RUN TestIPv4AddressOrEmpty/255.255.255.255 --- PASS: TestIPv4AddressOrEmpty (0.00s) --- PASS: TestIPv4AddressOrEmpty/#00 (0.00s) --- PASS: TestIPv4AddressOrEmpty/0.0.0.0 (0.00s) --- PASS: TestIPv4AddressOrEmpty/1.2.3.no (0.00s) --- PASS: TestIPv4AddressOrEmpty/text (0.00s) --- PASS: TestIPv4AddressOrEmpty/1.2.3.4 (0.00s) --- PASS: TestIPv4AddressOrEmpty/12.34.43.21 (0.00s) --- PASS: TestIPv4AddressOrEmpty/100.123.199.0 (0.00s) --- PASS: TestIPv4AddressOrEmpty/255.255.255.255 (0.00s) === RUN TestMACAddress === RUN TestMACAddress/#00 === RUN TestMACAddress/text_d === RUN TestMACAddress/12:34:no === RUN TestMACAddress/123:34:56:78:90:ab === RUN TestMACAddress/12:34:56:78:90:NO === RUN TestMACAddress/12:34:56:78:90:ab === RUN TestMACAddress/ab:cd:ef:AB:CD:EF --- PASS: TestMACAddress (0.00s) --- PASS: TestMACAddress/#00 (0.00s) --- PASS: TestMACAddress/text_d (0.00s) --- PASS: TestMACAddress/12:34:no (0.00s) --- PASS: TestMACAddress/123:34:56:78:90:ab (0.00s) --- PASS: TestMACAddress/12:34:56:78:90:NO (0.00s) --- PASS: TestMACAddress/12:34:56:78:90:ab (0.00s) --- PASS: TestMACAddress/ab:cd:ef:AB:CD:EF (0.00s) === RUN TestRFC3339Time === RUN TestRFC3339Time/#00 === RUN TestRFC3339Time/this_is_not_a_date === RUN TestRFC3339Time/2000-01-01 === RUN TestRFC3339Time/2000-01-01T01:23:45 === RUN TestRFC3339Time/2000-01-01T01:23:45Z === RUN TestRFC3339Time/2000-01-01T01:23:45+00:00 --- PASS: TestRFC3339Time (0.00s) --- PASS: TestRFC3339Time/#00 (0.00s) --- PASS: TestRFC3339Time/this_is_not_a_date (0.00s) --- PASS: TestRFC3339Time/2000-01-01 (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45 (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45Z (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45+00:00 (0.00s) === RUN TestRfc3339DateInFutureBy === RUN TestRfc3339DateInFutureBy/empty === RUN TestRfc3339DateInFutureBy/not_a_time === RUN TestRfc3339DateInFutureBy/now_is_not_1_hour_ahead === RUN TestRfc3339DateInFutureBy/now_+_7_hours_is_not_1_hour_ahead === RUN TestRfc3339DateInFutureBy/now_+_7_min_is_7_min_ahead === RUN TestRfc3339DateInFutureBy/now_+_8_min_is_at_least_7_min_ahead --- PASS: TestRfc3339DateInFutureBy (0.00s) --- PASS: TestRfc3339DateInFutureBy/empty (0.00s) --- PASS: TestRfc3339DateInFutureBy/not_a_time (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_is_not_1_hour_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_7_hours_is_not_1_hour_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_7_min_is_7_min_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_8_min_is_at_least_7_min_ahead (0.00s) === RUN TestURLIsHTTPOrHTTPS === RUN TestURLIsHTTPOrHTTPS/#00 === RUN TestURLIsHTTPOrHTTPS/this_is_not_a_url === RUN TestURLIsHTTPOrHTTPS/www.example.com === RUN TestURLIsHTTPOrHTTPS/ftp://www.example.com === RUN TestURLIsHTTPOrHTTPS/http://www.example.com === RUN TestURLIsHTTPOrHTTPS/https://www.example.com --- PASS: TestURLIsHTTPOrHTTPS (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/#00 (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/this_is_not_a_url (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/ftp://www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/http://www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/https://www.example.com (0.00s) === RUN TestUrlWithScheme === RUN TestUrlWithScheme/TestUrlWithScheme --- PASS: TestUrlWithScheme (0.00s) --- PASS: TestUrlWithScheme/TestUrlWithScheme (0.00s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate 0.027s ``` * `IP4Address` -> `IPv4Address` Tests pass: ``` $ go test ./azurerm/helpers/validate/ -v === RUN TestIPv4Address === RUN TestIPv4Address/#00 === RUN TestIPv4Address/0.0.0.0 === RUN TestIPv4Address/1.2.3.no === RUN TestIPv4Address/text === RUN TestIPv4Address/1.2.3.4 === RUN TestIPv4Address/12.34.43.21 === RUN TestIPv4Address/100.123.199.0 === RUN TestIPv4Address/255.255.255.255 --- PASS: TestIPv4Address (0.00s) --- PASS: TestIPv4Address/#00 (0.00s) --- PASS: TestIPv4Address/0.0.0.0 (0.00s) --- PASS: TestIPv4Address/1.2.3.no (0.00s) --- PASS: TestIPv4Address/text (0.00s) --- PASS: TestIPv4Address/1.2.3.4 (0.00s) --- PASS: TestIPv4Address/12.34.43.21 (0.00s) --- PASS: TestIPv4Address/100.123.199.0 (0.00s) --- PASS: TestIPv4Address/255.255.255.255 (0.00s) === RUN TestIPv4AddressOrEmpty === RUN TestIPv4AddressOrEmpty/#00 === RUN TestIPv4AddressOrEmpty/0.0.0.0 === RUN TestIPv4AddressOrEmpty/1.2.3.no === RUN TestIPv4AddressOrEmpty/text === RUN TestIPv4AddressOrEmpty/1.2.3.4 === RUN TestIPv4AddressOrEmpty/12.34.43.21 === RUN TestIPv4AddressOrEmpty/100.123.199.0 === RUN TestIPv4AddressOrEmpty/255.255.255.255 --- PASS: TestIPv4AddressOrEmpty (0.00s) --- PASS: TestIPv4AddressOrEmpty/#00 (0.00s) --- PASS: TestIPv4AddressOrEmpty/0.0.0.0 (0.00s) --- PASS: TestIPv4AddressOrEmpty/1.2.3.no (0.00s) --- PASS: TestIPv4AddressOrEmpty/text (0.00s) --- PASS: TestIPv4AddressOrEmpty/1.2.3.4 (0.00s) --- PASS: TestIPv4AddressOrEmpty/12.34.43.21 (0.00s) --- PASS: TestIPv4AddressOrEmpty/100.123.199.0 (0.00s) --- PASS: TestIPv4AddressOrEmpty/255.255.255.255 (0.00s) === RUN TestMACAddress === RUN TestMACAddress/#00 === RUN TestMACAddress/text_d === RUN TestMACAddress/12:34:no === RUN TestMACAddress/123:34:56:78:90:ab === RUN TestMACAddress/12:34:56:78:90:NO === RUN TestMACAddress/12:34:56:78:90:ab === RUN TestMACAddress/ab:cd:ef:AB:CD:EF --- PASS: TestMACAddress (0.00s) --- PASS: TestMACAddress/#00 (0.00s) --- PASS: TestMACAddress/text_d (0.00s) --- PASS: TestMACAddress/12:34:no (0.00s) --- PASS: TestMACAddress/123:34:56:78:90:ab (0.00s) --- PASS: TestMACAddress/12:34:56:78:90:NO (0.00s) --- PASS: TestMACAddress/12:34:56:78:90:ab (0.00s) --- PASS: TestMACAddress/ab:cd:ef:AB:CD:EF (0.00s) === RUN TestRFC3339Time === RUN TestRFC3339Time/#00 === RUN TestRFC3339Time/this_is_not_a_date === RUN TestRFC3339Time/2000-01-01 === RUN TestRFC3339Time/2000-01-01T01:23:45 === RUN TestRFC3339Time/2000-01-01T01:23:45Z === RUN TestRFC3339Time/2000-01-01T01:23:45+00:00 --- PASS: TestRFC3339Time (0.00s) --- PASS: TestRFC3339Time/#00 (0.00s) --- PASS: TestRFC3339Time/this_is_not_a_date (0.00s) --- PASS: TestRFC3339Time/2000-01-01 (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45 (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45Z (0.00s) --- PASS: TestRFC3339Time/2000-01-01T01:23:45+00:00 (0.00s) === RUN TestRfc3339DateInFutureBy === RUN TestRfc3339DateInFutureBy/empty === RUN TestRfc3339DateInFutureBy/not_a_time === RUN TestRfc3339DateInFutureBy/now_is_not_1_hour_ahead === RUN TestRfc3339DateInFutureBy/now_+_7_hours_is_not_1_hour_ahead === RUN TestRfc3339DateInFutureBy/now_+_7_min_is_7_min_ahead === RUN TestRfc3339DateInFutureBy/now_+_8_min_is_at_least_7_min_ahead --- PASS: TestRfc3339DateInFutureBy (0.00s) --- PASS: TestRfc3339DateInFutureBy/empty (0.00s) --- PASS: TestRfc3339DateInFutureBy/not_a_time (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_is_not_1_hour_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_7_hours_is_not_1_hour_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_7_min_is_7_min_ahead (0.00s) --- PASS: TestRfc3339DateInFutureBy/now_+_8_min_is_at_least_7_min_ahead (0.00s) === RUN TestURLIsHTTPOrHTTPS === RUN TestURLIsHTTPOrHTTPS/#00 === RUN TestURLIsHTTPOrHTTPS/this_is_not_a_url === RUN TestURLIsHTTPOrHTTPS/www.example.com === RUN TestURLIsHTTPOrHTTPS/ftp://www.example.com === RUN TestURLIsHTTPOrHTTPS/http://www.example.com === RUN TestURLIsHTTPOrHTTPS/https://www.example.com --- PASS: TestURLIsHTTPOrHTTPS (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/#00 (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/this_is_not_a_url (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/ftp://www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/http://www.example.com (0.00s) --- PASS: TestURLIsHTTPOrHTTPS/https://www.example.com (0.00s) === RUN TestUrlWithScheme === RUN TestUrlWithScheme/TestUrlWithScheme --- PASS: TestUrlWithScheme (0.00s) --- PASS: TestUrlWithScheme/TestUrlWithScheme (0.00s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate 0.028s ``` * Adding a test covering setting a blank IP address
- Loading branch information