Skip to content

Commit

Permalink
testing file creation via gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Feb 11, 2021
1 parent 35336ca commit b940416
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: 1.14
# create fake default config of srl for tests to validate path
- run: sudo mkdir -p /etc/containerlab/templates/srl && sudo touch /etc/containerlab/templates/srl/srlconfig.tpl
- run: go test -cover ./...
env:
CGO_ENABLED: 0
Expand Down
29 changes: 13 additions & 16 deletions clab/config_test.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
package clab

import (
"io/ioutil"
"log"
"os"
"path/filepath"
"reflect"
"strings"
"testing"
)

func init() {
// func init() {

// create default config file for srl to let parse topology func to pass
if _, err := os.Stat(defaultConfigTemplates["srl"]); err != nil {
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)
}
}
}
// // create default config file for srl to let parse topology func to pass
// if _, err := os.Stat(defaultConfigTemplates["srl"]); err != nil {
// 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)
// }
// }
// }

func TestLicenseInit(t *testing.T) {
tests := map[string]struct {
Expand Down

0 comments on commit b940416

Please sign in to comment.