Skip to content

Commit 0e41cf0

Browse files
committed
Use only randomChars for helper testacc (part2)
1 parent 7e75149 commit 0e41cf0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

libvirt/resource_libvirt_coreos_ignition_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func TestAccLibvirtIgnition_Basic(t *testing.T) {
1414
var volume libvirt.StorageVol
1515
randomServiceName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + ".service"
16-
randomIgnitionName := acctest.RandString(9)
16+
randomIgnitionName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
1717
var config = fmt.Sprintf(`
1818
data "ignition_systemd_unit" "acceptance-test-systemd" {
1919
name = "%s"

libvirt/resource_libvirt_domain_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestAccLibvirtDomain_VolumeTwoDisks(t *testing.T) {
123123
var domain libvirt.Domain
124124
var volume libvirt.StorageVol
125125
randomVolumeName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
126-
randomVolumeName2 := acctest.RandString(9)
126+
randomVolumeName2 := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
127127
randomDomainName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
128128

129129
var configVolAttached = fmt.Sprintf(`
@@ -182,7 +182,7 @@ func TestAccLibvirtDomain_VolumeDriver(t *testing.T) {
182182
var volumeRaw libvirt.StorageVol
183183
var volumeQCOW2 libvirt.StorageVol
184184
randomVolumeQCOW2 := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
185-
randomVolumeRaw := acctest.RandString(9)
185+
randomVolumeRaw := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
186186
randomDomainName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
187187

188188
var config = fmt.Sprintf(`

libvirt/resource_libvirt_pool_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ func testAccCheckLibvirtPoolDoesNotExists(n string, pool *libvirt.StoragePool) r
6161

6262
func TestAccLibvirtPool_Basic(t *testing.T) {
6363
var pool libvirt.StoragePool
64-
randomPoolResource := acctest.RandString(10)
65-
randomPoolName := acctest.RandString(10)
64+
randomPoolResource := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
65+
randomPoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
6666
poolPath := "/tmp/cluster-api-provider-libvirt-pool-" + randomPoolName
6767
resource.Test(t, resource.TestCase{
6868
PreCheck: func() { testAccPreCheck(t) },
@@ -94,8 +94,8 @@ func TestAccLibvirtPool_Basic(t *testing.T) {
9494
// This test should fail without a proper "Exists" implementation
9595
func TestAccLibvirtPool_ManuallyDestroyed(t *testing.T) {
9696
var pool libvirt.StoragePool
97-
randomPoolResource := acctest.RandString(10)
98-
randomPoolName := acctest.RandString(10)
97+
randomPoolResource := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
98+
randomPoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
9999
poolPath := "/tmp/cluster-api-provider-libvirt-pool-" + randomPoolName
100100
testAccCheckLibvirtPoolConfigBasic := fmt.Sprintf(`
101101
resource "libvirt_pool" "%s" {
@@ -131,9 +131,9 @@ func TestAccLibvirtPool_ManuallyDestroyed(t *testing.T) {
131131
}
132132

133133
func TestAccLibvirtPool_UniqueName(t *testing.T) {
134-
randomPoolName := acctest.RandString(10)
135-
randomPoolResource2 := acctest.RandString(10)
136-
randomPoolResource := acctest.RandString(10)
134+
randomPoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
135+
randomPoolResource2 := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
136+
randomPoolResource := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
137137
poolPath := "/tmp/cluster-api-provider-libvirt-pool-" + randomPoolName
138138
poolPath2 := "/tmp/cluster-api-provider-libvirt-pool-" + randomPoolName + "-2"
139139
config := fmt.Sprintf(`
@@ -164,8 +164,8 @@ func TestAccLibvirtPool_UniqueName(t *testing.T) {
164164
}
165165

166166
func TestAccLibvirtPool_NoDirPath(t *testing.T) {
167-
randomPoolResource := acctest.RandString(10)
168-
randomPoolName := acctest.RandString(10)
167+
randomPoolResource := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
168+
randomPoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)
169169
resource.Test(t, resource.TestCase{
170170
PreCheck: func() { testAccPreCheck(t) },
171171
Providers: testAccProviders,

0 commit comments

Comments
 (0)