Documentation ¶
Overview ¶
Package utils contains helper utils for osconfig_tests.
Index ¶
- Variables
- func CreateComputeInstance(metadataitems []*api.MetadataItems, client daisyCompute.Client, ...) (*compute.Instance, error)
- func GetStatusFromError(err error) string
- func InstallOSConfigDeb() 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 DowngradeAptImages = map[string]string{
"debian-cloud/debian-10": "projects/debian-cloud/global/images/debian-10-buster-v20231010",
}
DowngradeAptImages is a single image that are used for testing downgrade case with apt-get
var HeadAptImages = map[string]string{
"debian-cloud/debian-11": "projects/debian-cloud/global/images/debian-11-bullseye-v20231010",
"debian-cloud/debian-12": "projects/debian-cloud/global/images/debian-12-bookworm-v20231010",
"ubuntu-os-cloud/ubuntu-2304": "projects/ubuntu-os-cloud/global/images/ubuntu-2304-lunar-amd64-v20231020",
"ubuntu-os-cloud/ubuntu-2314": "projects/ubuntu-os-cloud/global/images/ubuntu-2310-mantic-amd64-v20231011",
}
HeadAptImages is a map of names to image paths for public image families that use APT.
var HeadCOSImages = map[string]string{
"cos-cloud/cos-stable": "projects/cos-cloud/global/images/cos-stable-109-17800-0-51",
"cos-cloud/cos-beta": "projects/cos-cloud/global/images/cos-beta-109-17800-0-51",
"cos-cloud/cos-dev": "projects/cos-cloud/global/images/cos-dev-113-17965-0-0",
}
HeadCOSImages is a map of names to image paths for public COS image families.
var HeadEL7Images = map[string]string{
"centos-cloud/centos-7": "projects/centos-cloud/global/images/centos-7-v20231010",
"rhel-cloud/rhel-7": "projects/rhel-cloud/global/images/rhel-7-v20231010",
"rhel-sap-cloud/rhel-7-sap": "projects/rhel-sap-cloud/global/images/rhel-7-9-sap-v20231011",
}
HeadEL7Images is a map of names to image paths for public EL7 image families. (RHEL, CentOS)
var HeadEL8Images = map[string]string{
"centos-cloud/centos-stream-8": "projects/centos-cloud/global/images/centos-stream-8-v20231010",
"rhel-cloud/rhel-8": "projects/rhel-cloud/global/images/rhel-8-v20231010",
"rhel-sap-cloud/rhel-8-1-sap": "projects/rhel-sap-cloud/global/images/rhel-8-1-sap-v20231010",
"rhel-sap-cloud/rhel-8-2-sap": "projects/rhel-sap-cloud/global/images/rhel-8-2-sap-v20231010",
"rhel-sap-cloud/rhel-8-4-sap": "projects/rhel-sap-cloud/global/images/rhel-8-4-sap-v20231010",
"rhel-sap-cloud/rhel-8-6-sap": "projects/rhel-sap-cloud/global/images/rhel-8-6-sap-v20231010",
"rhel-sap-cloud/rhel-8-8-sap": "projects/rhel-sap-cloud/global/images/rhel-8-8-sap-v20231010",
"rocky-linux-cloud/rocky-linux-8": "projects/rocky-linux-cloud/global/images/rocky-linux-8-v20231010",
"rocky-linux-cloud/rocky-linux-8-opt-gcp": "projects/rocky-linux-cloud/global/images/rocky-linux-8-optimized-gcp-v20231010",
}
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/centos-stream-9-v20231010",
"rhel-cloud/rhel-9": "projects/rhel-cloud/global/images/rhel-9-v20231010",
"rhel-sap-cloud/rhel-9-0-sap": "projects/rhel-sap-cloud/global/images/rhel-9-0-sap-v20231010",
"rhel-sap-cloud/rhel-9-2-sap": "projects/rhel-sap-cloud/global/images/rhel-9-2-sap-v20231010",
"rocky-linux-cloud/rocky-linux-9": "projects/rocky-linux-cloud/global/images/rocky-linux-9-v20231010",
"rocky-linux-cloud/rocky-linux-9-opt-gcp": "projects/rocky-linux-cloud/global/images/rocky-linux-9-optimized-gcp-v20231010",
}
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 HeadEL7Images { newMap[k] = v } 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 = map[string]string{
"suse-cloud/sles-12-sp5": "projects/suse-cloud/global/images/sles-12-sp5-v20230807-x86-64",
"suse-cloud/sles-15-sp5": "projects/suse-cloud/global/images/sles-15-sp5-v20230921-x86-64",
"suse-sap-cloud/sles-12-sp5-sap": "projects/suse-sap-cloud/global/images/sles-12-sp5-sap-v20231019-x86-64",
"suse-sap-cloud/sles-15-sp5-sap": "projects/suse-sap-cloud/global/images/sles-15-sp5-sap-v20230921-x86-64",
"suse-sap-cloud/sles-15-sp4-hardened-sap": "projects/suse-sap-cloud/global/images/sles-sap-15-sp4-hardened-v20230828-x86-64",
"suse-sap-cloud/sles-15-sp5-hardened-sap": "projects/suse-sap-cloud/global/images/sles-sap-15-sp5-hardened-v20230921-x86-64",
"opensuse-cloud/opensuse-leap-15-4": "projects/opensuse-cloud/global/images/opensuse-leap-15-4-v20230907-x86-64",
"opensuse-cloud/opensuse-leap-15-5": "projects/opensuse-cloud/global/images/opensuse-leap-15-5-v20230908-x86-64",
}
HeadSUSEImages is a map of names to image paths for public SUSE images.
var HeadWindowsImages = map[string]string{
"windows-cloud/win-2016-dc-core": "projects/windows-cloud/global/images/windows-server-2016-dc-core-v20231011",
"windows-cloud/win-2016-dc": "projects/windows-cloud/global/images/windows-server-2016-dc-v20231011",
"windows-cloud/win-2019-dc-core": "projects/windows-cloud/global/images/windows-server-2019-dc-core-v20231011",
"windows-cloud/win-2019-dc": "projects/windows-cloud/global/images/windows-server-2019-dc-v20231011",
"windows-cloud/win-2022-dc-core": "projects/windows-cloud/global/images/windows-server-2022-dc-core-v20231011",
"windows-cloud/win-2022-dc": "projects/windows-cloud/global/images/windows-server-2022-dc-v20231011",
}
HeadWindowsImages is a map of names to image paths for public Windows image families.
var OldAptImages = map[string]string{
"old/debian-10": "projects/debian-cloud/global/images/debian-10-buster-v20231010",
"old/ubuntu-2004": "projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20230918",
}
OldAptImages is a map of names to image paths for old (deprecated) images that use APT.
var OldEL7Images = map[string]string{}
OldEL7Images is a map of names to image paths for old EL7 images.
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 = map[string]string{
"old/sles-15-sp1-sap": "projects/suse-sap-cloud/global/images/sles-15-sp1-sap-v20221108-x86-64",
"old/sles-15-sp2-sap": "projects/suse-sap-cloud/global/images/sles-15-sp2-sap-v20221108-x86-64",
"old/sles-15-sp3-sap": "projects/suse-sap-cloud/global/images/sles-15-sp3-sap-v20221108-x86-64",
"old/sles-15-sp4-sap": "projects/suse-sap-cloud/global/images/sles-15-sp4-sap-v20230623-x86-64",
}
OldSUSEImages is a map of names to image paths for old 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 GetStatusFromError ¶
GetStatusFromError return a string that contains all information about the error that is created from a status
func InstallOSConfigDeb ¶
func InstallOSConfigDeb() string
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.