ea1e4c38fa
This reverts commitcdfc94f4e9
, reversing changes made to2051cd3e1c
. Conflicts: config/config.go config/config_test.go config/etc_hosts.go config/etcd.go config/file.go config/fleet.go config/oem.go config/unit.go config/update.go config/user.go initialize/config.go initialize/config_test.go initialize/env.go initialize/manage_etc_hosts.go initialize/workspace.go system/env.go system/etc_hosts_test.go system/etcd.go system/etcd_test.go system/fleet.go system/fleet_test.go system/oem.go system/oem_test.go system/systemd.go system/update.go system/update_test.go test
33 lines
616 B
Go
33 lines
616 B
Go
package initialize
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCloudConfigUsersGithubUser(t *testing.T) {
|
|
|
|
contents := `
|
|
users:
|
|
- name: elroy
|
|
coreos-ssh-import-github: bcwaldon
|
|
`
|
|
cfg, err := NewCloudConfig(contents)
|
|
if err != nil {
|
|
t.Fatalf("Encountered unexpected error: %v", err)
|
|
}
|
|
|
|
if len(cfg.Users) != 1 {
|
|
t.Fatalf("Parsed %d users, expected 1", len(cfg.Users))
|
|
}
|
|
|
|
user := cfg.Users[0]
|
|
|
|
if user.Name != "elroy" {
|
|
t.Errorf("User name is %q, expected 'elroy'", user.Name)
|
|
}
|
|
|
|
if user.SSHImportGithubUser != "bcwaldon" {
|
|
t.Errorf("github user is %q, expected 'bcwaldon'", user.SSHImportGithubUser)
|
|
}
|
|
}
|