diff --git a/google_guest_agent/oslogin.go b/google_guest_agent/oslogin.go index ab18fb97..37a13ffa 100644 --- a/google_guest_agent/oslogin.go +++ b/google_guest_agent/oslogin.go @@ -141,7 +141,8 @@ func (o *osloginMgr) Disabled(ctx context.Context) (bool, error) { func setupSles16OSLoginDirs() error { isSles16 := strings.Contains(osInfo.OS, "sles") || strings.Contains(osInfo.OS, "opensuse") - if !isSles16 || osInfo.Version.Major != 16 { + isSLMicro := strings.Contains(osInfo.OS, "sl-micro") + if !((isSles16 && osInfo.Version.Major == 16) || isSLMicro) { logger.Infof("Skipping OSLogin SLES 16 specific setup on %q %d", osInfo.OS, osInfo.Version.Major) return nil } diff --git a/google_guest_agent/oslogin_linux_test.go b/google_guest_agent/oslogin_linux_test.go index 6d327594..7404cced 100644 --- a/google_guest_agent/oslogin_linux_test.go +++ b/google_guest_agent/oslogin_linux_test.go @@ -890,6 +890,21 @@ func TestSetupUsrEtcOSLoginDirs(t *testing.T) { dstShouldExist: true, prevSetup: true, }, + { + name: "sle-micro-no-copy", + info: osinfo.OSInfo{OS: "sle-micro", Version: osinfo.Ver{Major: 5}}, + createSrc: true, + createDst: false, + dstShouldExist: false, + }, + { + name: "sl-micro-copy", + info: osinfo.OSInfo{OS: "sl-micro", Version: osinfo.Ver{Major: 6}}, + createSrc: true, + createDst: false, + dstShouldExist: true, + dstContent: "test", + }, } for _, tt := range tests {