cloud_init_test.go 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestReadDatasourcesFromDisk(c *C) {
  4. s.RunQemu(c)
  5. s.CheckCall(c, `
  6. sudo tee /var/lib/rancher/conf/cloud-config.d/datasources.yml << EOF
  7. rancher:
  8. cloud_init:
  9. datasources:
  10. - url:https://gist.githubusercontent.com/joshwget/e1c49f8b1ddeeba01bc9d0a3be01ed60/raw/9168b380fde182d53acea487d49b680648a0ca5b/gistfile1.txt
  11. EOF
  12. `)
  13. s.Reboot(c)
  14. s.CheckCall(c, "sudo ros config get rancher.log | grep true")
  15. }
  16. func (s *QemuSuite) TestIsoCloudConfig(c *C) {
  17. runArgs := []string{
  18. "--fresh",
  19. "--cloud-config-iso",
  20. }
  21. s.RunQemuWith(c, runArgs...)
  22. s.CheckCall(c, `ls .ssh/authorized_keys`)
  23. }
  24. func (s *QemuSuite) TestFatCloudConfig(c *C) {
  25. runArgs := []string{
  26. "--fresh",
  27. "--cloud-config-fat",
  28. }
  29. s.RunQemuWith(c, runArgs...)
  30. s.CheckCall(c, `ls .ssh/authorized_keys`)
  31. }