Documentation ¶
Overview ¶
Package utils contains helper utils for osconfig_tests.
Index ¶
- Variables
- func CreateComputeInstance(metadataitems []*api.MetadataItems, client daisyCompute.Client, ...) (*compute.Instance, error)
- func GetDebOsName(image string) string
- func GetStatusFromError(err error) string
- func InstallOSConfigDeb(image string) string
- func InstallOSConfigEL(image string) string
- func InstallOSConfigEL7() string
- func InstallOSConfigEL8() string
- func InstallOSConfigEL9() string
- func InstallOSConfigGooGet() string
- func InstallOSConfigSUSE() string
- func RandString(n int) string
Constants ¶
This section is empty.
Variables ¶
var ( // CosSetup sets up serial logging on COS. CosSetup = ` sleep 10 sed -i 's/^#ForwardToConsole=no/ForwardToConsole=yes/' /etc/systemd/journald.conf sed -i 's/^#MaxLevelConsole=info/MaxLevelConsole=debug/' /etc/systemd/journald.conf MaxLevelConsole=debug systemctl force-reload systemd-journald systemctl restart google-osconfig-agent` + CurlPost // CurlPost indicates agent is installed. CurlPost = `` /* 325-byte string literal not displayed */ )
var DowngradeBullseyeAptImages = map[string]string{
"debian-cloud/debian-11": "projects/debian-cloud/global/images/debian-11-bullseye-v20231010",
}
DowngradeBullseyeAptImages is a single image that are used for testing downgrade case with apt-get
var HeadAptImages = func() (newMap map[string]string) { newMap = make(map[string]string) for k, v := range HeadBusterAptImages { newMap[k] = v } for k, v := range HeadBullseyeAptImages { newMap[k] = v } for k, v := range HeadBookwormAptImages { newMap[k] = v } return }()
HeadAptImages is a map of names to image paths for public EL image families. (RHEL, CentOS, Rocky)
var HeadBookwormAptImages = map[string]string{
"debian-cloud/debian-12": "projects/debian-cloud/global/images/family/debian-12",
}
HeadBookwormAptImages is a map of names to image paths for public debian-12 images
var HeadBullseyeAptImages = map[string]string{
"debian-cloud/debian-11": "projects/debian-cloud/global/images/family/debian-11",
}
HeadBullseyeAptImages is a map of names to image paths for public debian-11 images
var HeadBusterAptImages = map[string]string{}
HeadBusterAptImages empty for now as debian-10 wil reach EOL and some of its repos are not reachable anymore.
var HeadCOSImages = map[string]string{
"cos-cloud/cos-stable": "projects/cos-cloud/global/images/family/cos-stable",
"cos-cloud/cos-beta": "projects/cos-cloud/global/images/family/cos-beta",
"cos-cloud/cos-dev": "projects/cos-cloud/global/images/family/cos-dev",
}
HeadCOSImages is a map of names to image paths for public COS image families.
var HeadEL8Images = map[string]string{
"rhel-cloud/rhel-8": "projects/rhel-cloud/global/images/family/rhel-8",
"rhel-sap-cloud/rhel-8-4-sap": "projects/rhel-sap-cloud/global/images/family/rhel-8-4-sap-ha",
"rhel-sap-cloud/rhel-8-6-sap": "projects/rhel-sap-cloud/global/images/family/rhel-8-6-sap-ha",
"rhel-sap-cloud/rhel-8-8-sap": "projects/rhel-sap-cloud/global/images/family/rhel-8-8-sap-ha",
"rocky-linux-cloud/rocky-linux-8": "projects/rocky-linux-cloud/global/images/family/rocky-linux-8",
"rocky-linux-cloud/rocky-linux-8-optimized-gcp": "projects/rocky-linux-cloud/global/images/family/rocky-linux-8-optimized-gcp",
}
HeadEL8Images is a map of names to image paths for public EL8 image families. (RHEL, CentOS, Rocky)
var HeadEL9Images = map[string]string{
"centos-cloud/centos-stream-9": "projects/centos-cloud/global/images/family/centos-stream-9",
"rhel-cloud/rhel-9": "projects/rhel-cloud/global/images/family/rhel-9",
"rhel-sap-cloud/rhel-9-0-sap": "projects/rhel-sap-cloud/global/images/family/rhel-9-0-sap-ha",
"rhel-sap-cloud/rhel-9-2-sap": "projects/rhel-sap-cloud/global/images/family/rhel-9-2-sap-ha",
"rocky-linux-cloud/rocky-linux-9": "projects/rocky-linux-cloud/global/images/family/rocky-linux-9",
"rocky-linux-cloud/rocky-linux-9-optimized-gcp": "projects/rocky-linux-cloud/global/images/family/rocky-linux-9-optimized-gcp",
}
HeadEL9Images is a map of names to image paths for public EL9 image families. (RHEL, CentOS, Rocky)
var HeadELImages = func() (newMap map[string]string) { newMap = make(map[string]string) for k, v := range HeadEL8Images { newMap[k] = v } for k, v := range HeadEL9Images { newMap[k] = v } return }()
HeadELImages is a map of names to image paths for public EL image families. (RHEL, CentOS, Rocky)
var HeadSUSEImages = func() map[string]string { imgsMap := make(map[string]string) if config.AgentRepo() != "testing" { imgsMap = map[string]string{ "suse-cloud/sles-12-sp5": "projects/suse-cloud/global/images/family/sles-12", "suse-cloud/sles-15-sp5": "projects/suse-cloud/global/images/family/sles-15", "suse-sap-cloud/sles-12-sp5-sap": "projects/suse-sap-cloud/global/images/family/sles-12-sp5-sap", "suse-sap-cloud/sles-15-sp5-sap": "projects/suse-sap-cloud/global/images/family/sles-15-sp5-sap", "suse-sap-cloud/sles-15-sp6-sap": "projects/suse-sap-cloud/global/images/family/sles-15-sp6-sap", "suse-sap-cloud/sles-15-sp5-hardened-sap": "projects/suse-sap-cloud/global/images/family/sles-sap-15-sp5-hardened", "opensuse-cloud/opensuse-leap-15": "projects/opensuse-cloud/global/images/family/opensuse-leap", } } return imgsMap }()
HeadSUSEImages is a map of names to image paths for public SUSE images.
var HeadWindowsImages = map[string]string{
"windows-cloud/windows-2016": "projects/windows-cloud/global/images/family/windows-2016",
"windows-cloud/windows-2016-core": "projects/windows-cloud/global/images/family/windows-2016-core",
"windows-cloud/windows-2019": "projects/windows-cloud/global/images/family/windows-2019",
"windows-cloud/windows-2019-core": "projects/windows-cloud/global/images/family/windows-2019-core",
}
HeadWindowsImages is a map of names to image paths for public Windows image families.
var OldEL8Images = map[string]string{}
OldEL8Images is a map of names to image paths for old EL8 images. (RHEL, CentOS, Rocky)
var OldEL9Images = map[string]string{}
OldEL9Images is a map of names to image paths for old EL9 images. (RHEL, CentOS, Rocky)
var OldSUSEImages = func() map[string]string { imgsMap := make(map[string]string) if config.AgentRepo() != "testing" { imgsMap = map[string]string{ "old/sles-15-sp3-sap": "projects/suse-sap-cloud/global/images/sles-15-sp3-sap-v20240808-x86-64", "old/sles-15-sp4-sap": "projects/suse-sap-cloud/global/images/sles-15-sp4-sap-v20240208-x86-64", } } return imgsMap }()
OldSUSEImages is a map of names to image paths for public SUSE images.
var OldWindowsImages = map[string]string{}
OldWindowsImages is a map of names to image paths for old Windows images.
Functions ¶
func CreateComputeInstance ¶
func CreateComputeInstance(metadataitems []*api.MetadataItems, client daisyCompute.Client, machineType, image, name, projectID, zone, serviceAccountEmail string, serviceAccountScopes []string) (*compute.Instance, error)
CreateComputeInstance is an utility function to create gce instance
func GetDebOsName ¶
GetDebOsName returns the equivalent os_name for deb version (e.g. debian-11 --> bullseye)
func GetStatusFromError ¶
GetStatusFromError return a string that contains all information about the error that is created from a status
func InstallOSConfigDeb ¶
InstallOSConfigDeb installs the osconfig agent on deb based systems.
func InstallOSConfigEL ¶
InstallOSConfigEL installs the osconfig agent on el based systems.
func InstallOSConfigEL7 ¶
func InstallOSConfigEL7() string
InstallOSConfigEL7 installs the osconfig agent on el7 based systems.
func InstallOSConfigEL8 ¶
func InstallOSConfigEL8() string
InstallOSConfigEL8 installs the osconfig agent on el8 based systems. (RHEL)
func InstallOSConfigEL9 ¶
func InstallOSConfigEL9() string
InstallOSConfigEL9 installs the osconfig agent on el9 based systems. (RHEL)
func InstallOSConfigGooGet ¶
func InstallOSConfigGooGet() string
InstallOSConfigGooGet installs the osconfig agent on Windows systems.
func InstallOSConfigSUSE ¶
func InstallOSConfigSUSE() string
InstallOSConfigSUSE installs the osconfig agent on suse systems.
Types ¶
This section is empty.