Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1516 from jcooklin/ib/1515-config_error
Browse files Browse the repository at this point in the history
Fixes #1515
  • Loading branch information
jcooklin authored Feb 13, 2017
2 parents 89bf6c0 + 8c0abcd commit 85079bc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mgmt/rest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Config struct {
RestAuthPassword string `json:"rest_auth_password"yaml:"rest_auth_password"`
portSetByConfig bool ``
Pprof bool `json:"pprof"yaml:"pprof"`
Corsd string `json:"corsd"yaml:"allowed_origins"`
Corsd string `json:"allowed_origins"yaml:"allowed_origins"`
}

const (
Expand Down
41 changes: 41 additions & 0 deletions snapteld_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2017 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"encoding/json"
"testing"

"github.com/intelsdi-x/snap/pkg/cfgfile"
. "github.com/smartystreets/goconvey/convey"
)

func TestSnapConfig(t *testing.T) {
Convey("Test Config", t, func() {
Convey("with defaults", func() {
cfg := getDefaultConfig()
jb, _ := json.Marshal(cfg)
serrs := cfgfile.ValidateSchema(CONFIG_CONSTRAINTS, string(jb))
So(len(serrs), ShouldEqual, 0)
})
})
}

0 comments on commit 85079bc

Please sign in to comment.