Skip to content

Commit

Permalink
Merge pull request #475 from MusicDin/test/cached-image
Browse files Browse the repository at this point in the history
Use Alpine images for cached image test
  • Loading branch information
simondeziel authored Jun 10, 2024
2 parents 7a6b4bd + 4f49e87 commit a32326a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/acctest/provider_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TestImage = "images:alpine/edge"
// TestCachedImage is a constant that specifies the default image used in image caching tests.
// NOTE: it must be different from TestImage otherwise tests running in parallel will race to
// use and delete that image causing random failures.
const TestCachedImage = "ubuntu-minimal-daily:22.04"
const TestCachedImage = "images:alpine/edge/cloud"

var TestCachedImageSourceRemote, TestCachedImageSourceImage, _ = strings.Cut(TestCachedImage, ":")

Expand Down
8 changes: 4 additions & 4 deletions internal/image/resource_cached_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestAccCachedImage_basic(t *testing.T) {
resource.TestCheckResourceAttr("lxd_cached_image.img1", "source_remote", acctest.TestCachedImageSourceRemote),
resource.TestCheckResourceAttr("lxd_cached_image.img1", "source_image", acctest.TestCachedImageSourceImage),
resource.TestCheckResourceAttr("lxd_cached_image.img1", "copy_aliases", "true"),
resource.TestCheckResourceAttr("lxd_cached_image.img1", "copied_aliases.#", "6"),
resource.TestCheckResourceAttr("lxd_cached_image.img1", "copied_aliases.#", "2"),
),
},
},
Expand All @@ -39,7 +39,7 @@ func TestAccCachedImage_basicVM(t *testing.T) {
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "source_remote", acctest.TestCachedImageSourceRemote),
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "source_image", acctest.TestCachedImageSourceImage),
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "copy_aliases", "true"),
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "copied_aliases.#", "6"),
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "copied_aliases.#", "2"),
resource.TestCheckResourceAttr("lxd_cached_image.img1vm", "type", "virtual-machine"),
),
},
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestAccCachedImage_copiedAliases(t *testing.T) {
resource.TestCheckTypeSetElemAttr("lxd_cached_image.img3", "aliases.*", acctest.TestCachedImageSourceImage),
resource.TestCheckTypeSetElemAttr("lxd_cached_image.img3", "aliases.*", alias1),
resource.TestCheckTypeSetElemAttr("lxd_cached_image.img3", "aliases.*", alias2),
resource.TestCheckResourceAttr("lxd_cached_image.img3", "copied_aliases.#", "6"),
resource.TestCheckResourceAttr("lxd_cached_image.img3", "copied_aliases.#", "2"),
),
},
},
Expand All @@ -109,7 +109,7 @@ func TestAccCachedImage_aliasCollision(t *testing.T) {
resource.TestCheckResourceAttr("lxd_cached_image.img4", "copy_aliases", "true"),
resource.TestCheckResourceAttr("lxd_cached_image.img4", "aliases.#", "1"),
resource.TestCheckResourceAttr("lxd_cached_image.img4", "aliases.0", acctest.TestCachedImageSourceImage+"/amd64"),
resource.TestCheckResourceAttr("lxd_cached_image.img4", "copied_aliases.#", "6"),
resource.TestCheckResourceAttr("lxd_cached_image.img4", "copied_aliases.#", "2"),
),
},
},
Expand Down

0 comments on commit a32326a

Please sign in to comment.