1
0
mirror of https://github.com/rancher/os.git synced 2025-06-26 06:51:40 +00:00
os/tests/ssh_key_merge_test.go

38 lines
600 B
Go
Raw Normal View History

2016-07-20 17:42:16 +00:00
package integration
2016-07-20 17:42:16 +00:00
import . "gopkg.in/check.v1"
2016-07-20 17:42:16 +00:00
func (s *QemuSuite) TestSshKeyMerge(c *C) {
2016-10-22 03:34:30 +00:00
s.RunQemu(c)
2016-07-20 17:42:16 +00:00
s.CheckCall(c, `
cat > test-merge << "SCRIPT"
set -x -e
rm /var/lib/rancher/conf/cloud-config.yml
EXISTING=$(ros config get ssh_authorized_keys | head -1)
cat > /var/lib/rancher/conf/metadata << EOF
SSHPublicKeys:
"0": zero
"1": one
"2": two
EOF
ros config set hostname one
ros config set hostname two
ros config set hostname three
cat > expected << EOF
$EXISTING
- zero
- one
- two
EOF
ros config get ssh_authorized_keys > got
diff got expected
SCRIPT
2016-07-20 17:42:16 +00:00
sudo bash test-merge`)
}