mirror of
https://github.com/rancher/os.git
synced 2025-09-08 18:20:32 +00:00
Make datasource.AvailabilityChanges() able to be dynamic so fail out for configdrive mount and url 404's faster
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
6
config/cloudinit/datasource/configdrive/configdrive_test.go
Normal file → Executable file
6
config/cloudinit/datasource/configdrive/configdrive_test.go
Normal file → Executable file
@@ -57,7 +57,7 @@ func TestFetchMetadata(t *testing.T) {
|
||||
},
|
||||
},
|
||||
} {
|
||||
cd := ConfigDrive{tt.root, tt.files.ReadFile, nil}
|
||||
cd := ConfigDrive{tt.root, tt.files.ReadFile, nil, true}
|
||||
metadata, err := cd.FetchMetadata()
|
||||
if err != nil {
|
||||
t.Fatalf("bad error for %+v: want %v, got %q", tt, nil, err)
|
||||
@@ -91,7 +91,7 @@ func TestFetchUserdata(t *testing.T) {
|
||||
"userdata",
|
||||
},
|
||||
} {
|
||||
cd := ConfigDrive{tt.root, tt.files.ReadFile, nil}
|
||||
cd := ConfigDrive{tt.root, tt.files.ReadFile, nil, true}
|
||||
userdata, err := cd.FetchUserdata()
|
||||
if err != nil {
|
||||
t.Fatalf("bad error for %+v: want %v, got %q", tt, nil, err)
|
||||
@@ -116,7 +116,7 @@ func TestConfigRoot(t *testing.T) {
|
||||
"/media/configdrive/openstack",
|
||||
},
|
||||
} {
|
||||
cd := ConfigDrive{tt.root, nil, nil}
|
||||
cd := ConfigDrive{tt.root, nil, nil, true}
|
||||
if configRoot := cd.ConfigRoot(); configRoot != tt.configRoot {
|
||||
t.Fatalf("bad config root for %q: want %q, got %q", tt, tt.configRoot, configRoot)
|
||||
}
|
||||
|
Reference in New Issue
Block a user