-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged lp:snappy and resolved conflicts
- Loading branch information
Showing
78 changed files
with
1,765 additions
and
827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
{{ $filter := .Filter }} | ||
{{ range $element := .Tests }} | ||
Test-Command: ./_integration-tests/reboot-wrapper {{ $element }}.test {{ if $filter }}-gocheck.f {{ $filter }}{{ end }} | ||
{{ $test := .Test }} | ||
Test-Command: ./_integration-tests/reboot-wrapper {{ $test }} {{ if $filter }}-gocheck.f {{ $filter }}{{ end }} | ||
Restrictions: allow-stderr | ||
{{ end }} | ||
|
||
{{ if .IncludeShell }} | ||
Test-Command: ./_integration-tests/snappy-selftest --yes-really | ||
Depends: | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// -*- Mode: Go; indent-tabs-mode: t -*- | ||
|
||
/* | ||
* Copyright (C) 2015 Canonical Ltd | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package config | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"log" | ||
) | ||
|
||
// Config contains the values to pass to the test bed from the host. | ||
type Config struct { | ||
FileName string | ||
Release string | ||
Channel string | ||
TargetRelease string | ||
TargetChannel string | ||
Update bool | ||
Rollback bool | ||
} | ||
|
||
// NewConfig is the Config constructor | ||
func NewConfig(fileName, release, channel, targetRelease, targetChannel string, update, rollback bool) *Config { | ||
return &Config{ | ||
FileName: fileName, Release: release, Channel: channel, | ||
TargetRelease: targetRelease, TargetChannel: targetChannel, | ||
Update: update, Rollback: rollback, | ||
} | ||
} | ||
|
||
// Write writes the config to a file that will be copied to the test bed. | ||
func (cfg Config) Write() { | ||
fmt.Println("Writing test config...") | ||
fmt.Println(cfg) | ||
encoded, err := json.Marshal(cfg) | ||
if err != nil { | ||
log.Panicf("Error encoding the test config: %v", err) | ||
} | ||
err = ioutil.WriteFile(cfg.FileName, encoded, 0644) | ||
if err != nil { | ||
log.Panicf("Error writing the test config: %v", err) | ||
} | ||
} | ||
|
||
// ReadConfig the config from a file | ||
func ReadConfig(fileName string) (*Config, error) { | ||
b, err := ioutil.ReadFile(fileName) | ||
if err != nil { | ||
return nil, err | ||
} | ||
var decoded Config | ||
if err = json.Unmarshal(b, &decoded); err != nil { | ||
return nil, err | ||
} | ||
return &decoded, nil | ||
} |
Oops, something went wrong.