Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7229481
create ssh keypair data-source
Damans227 Jun 13, 2022
3728391
create a method stub for instance data-source
Damans227 May 31, 2022
eec69c8
extending instance data-source to use its id as an input
Damans227 Jun 2, 2022
f6bf228
use SetId() to define the ID of the instance resource
Damans227 Jun 3, 2022
1c9dfbb
implement filters to allow filtering off of any exported attributes
Damans227 Jun 4, 2022
99ffd71
add ip-address to schema and allow filtering off of it
Damans227 Jun 6, 2022
7ea2d60
create a method stub to acceptance test the instance data-source
Damans227 Jun 8, 2022
c4f18cc
basic acceptance test for instance data-source passing
Damans227 Jun 11, 2022
0244431
adding comments to improve the readability of code
Damans227 Jun 12, 2022
49a279d
add basic acceptance test for ssh keypair data-source
Damans227 Jun 14, 2022
2cff5eb
create network offering resource
Damans227 Jun 17, 2022
f4d6d3e
complete network offering resource type
Damans227 Jun 21, 2022
10d2b8b
create network offering data source
Damans227 Jun 21, 2022
fcc5d60
add basic acceptance test for network offering data source
Damans227 Jun 21, 2022
2a36da5
create disk offering resource
Damans227 Jun 27, 2022
420c5f9
implement create method for disk offering resource
Damans227 Jun 28, 2022
1458501
create cloudstack volume resource type
Damans227 Jun 28, 2022
6860034
create cloudstack zone resource type
Damans227 Jun 29, 2022
4b06faf
create zone data source
Damans227 Jul 7, 2022
165ea84
add acceptance test for zone datasource
Damans227 Jul 11, 2022
5401174
create service offering resource
Damans227 Jul 14, 2022
cc3275c
create service offering data source
Damans227 Jul 15, 2022
a8fe27e
add service offering data source
Damans227 Jul 19, 2022
4ad74f1
fix typos in comments for network offering resource
Damans227 Aug 6, 2022
fc488e0
add volume data source
Damans227 Aug 11, 2022
d4ee481
add acceptance test for volume data source
Damans227 Aug 15, 2022
eae747c
create account resource
Damans227 Aug 17, 2022
c78b1fc
implement delete method in account resource
Damans227 Aug 19, 2022
bce3a32
fix a typo in network offering
Damans227 Aug 19, 2022
5015e80
create user resource
Damans227 Aug 21, 2022
b0f5371
create domain resource
Damans227 Aug 22, 2022
0ad1d96
add vpc data-source
Damans227 Aug 27, 2022
b406da4
add ip address data-source
Damans227 Aug 27, 2022
1c19867
add user data-source
Damans227 Aug 27, 2022
4c46983
add vpn connection data-source
Damans227 Aug 27, 2022
d8abde2
add acceptance test for vpc data-source
Damans227 Aug 28, 2022
4c1e531
add acceptance test for ipaddress data-source
Damans227 Aug 28, 2022
447e29f
add acceptance test for user data-source
Damans227 Aug 28, 2022
04aae0d
fix a typo in applyNetworkOfferingFilters method of network offering …
Damans227 Aug 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions cloudstack/data_source_cloudstack_network_offering_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//

package cloudstack

import (
"testing"

"github.com/hashicorp/terraform/helper/resource"
)

func TestAccNetworkOfferingDataSource_basic(t *testing.T) {
resourceName := "cloudstack_network_offering.net-off-resource"
datasourceName := "data.cloudstack_network_offering.net-off-data-source"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testNetworkOfferingDataSourceConfig_basic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"),
),
ExpectNonEmptyPlan: true,
},
},
})
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


 ❯ TF_ACC=1 go test -run TestAccNetworkOfferingDataSource_basic -v
=== RUN   TestAccNetworkOfferingDataSource_basic
--- PASS: TestAccNetworkOfferingDataSource_basic (0.26s)
PASS
ok    

const testNetworkOfferingDataSourceConfig_basic = `
resource "cloudstack_network_offering" "net-off-resource"{
name = "TestNetworkDisplay01"
display_text = "TestNetworkDisplay01"
guest_ip_type = "Isolated"
traffic_type = "Guest"
}

data "cloudstack_network_offering" "net-off-data-source"{

filter{
name = "name"
value="TestNetworkDisplay01"
}
depends_on = [
cloudstack_network_offering.net-off-resource
]
}
`