1
0
mirror of https://github.com/rancher/os.git synced 2025-06-25 06:21:33 +00:00
os/tests/ssh_key_merge_test.go
2016-07-20 10:42:16 -07:00

40 lines
629 B
Go

package integration
import . "gopkg.in/check.v1"
func (s *QemuSuite) TestSshKeyMerge(c *C) {
err := s.RunQemu()
c.Assert(err, IsNil)
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
sudo bash test-merge`)
}