Skip to content

Commit

Permalink
added creation of dirs for test files
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Feb 11, 2021
1 parent 9ef21f4 commit 35336ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions clab/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ func init() {

// create default config file for srl to let parse topology func to pass
if _, err := os.Stat(defaultConfigTemplates["srl"]); err != nil {
ferr := ioutil.WriteFile(defaultConfigTemplates["srl"], []byte("testing file"), 0600)
if ferr != nil {
log.Fatal(ferr)
err2 := os.MkdirAll("/etc/containerlab/templates/srl", 0600)
if err2 != nil {
log.Fatal(err2)
}
err2 = ioutil.WriteFile(defaultConfigTemplates["srl"], []byte("testing file"), 0600)
if err2 != nil {
log.Fatal(err2)
}
}
}
Expand Down

0 comments on commit 35336ca

Please sign in to comment.