1
0
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:
Sven Dowideit
2017-03-02 11:52:29 +10:00
parent 78051c2814
commit 10a4c59385
5 changed files with 96 additions and 97 deletions

View 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)
}