helpers

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContainerLogs

func CheckContainerLogs(conn *synology.Connection, containerName, expectedLogContent string) error

CheckContainerLogs retrieves and checks container logs

func CreateTestDirectory

func CreateTestDirectory(conn *synology.Connection, path string) error

CreateTestDirectory creates a directory on the NAS for testing

func CreateTestFile

func CreateTestFile(conn *synology.Connection, filePath, content string) error

CreateTestFile creates a file with specified content on the NAS

func CreateTestFileInContainer added in v0.2.2

func CreateTestFileInContainer(conn *synology.Connection, containerName, filePath, content string) error

CreateTestFileInContainer creates a file inside a running container

func GetContainerIP

func GetContainerIP(conn *synology.Connection, containerName string) (string, error)

GetContainerIP retrieves the IP address of a container

func RandomString

func RandomString(length int) string

RandomString generates a random string of specified length

func ReadTestFileFromContainer added in v0.2.2

func ReadTestFileFromContainer(conn *synology.Connection, containerName, filePath string) (string, error)

ReadTestFileFromContainer reads a file from inside a running container

func TestContainerConnectivity

func TestContainerConnectivity(conn *synology.Connection, fromContainer, toContainer string, port int) error

TestContainerConnectivity tests network connectivity between containers

func TestHTTPEndpoint

func TestHTTPEndpoint(url, expectedContent string, timeout time.Duration) error

TestHTTPEndpoint tests if an HTTP endpoint is accessible and returns expected content

func VerifyImageExists added in v0.2.2

func VerifyImageExists(conn *synology.Connection, imageName string) (bool, error)

VerifyImageExists checks if an image exists in the image list

func VerifyNetworkExists added in v0.2.2

func VerifyNetworkExists(conn *synology.Connection, networkName string) (bool, error)

VerifyNetworkExists checks if a network exists in the network list

func VerifyVolumeExists added in v0.2.2

func VerifyVolumeExists(conn *synology.Connection, volumeName string) (bool, error)

VerifyVolumeExists checks if a volume exists in the volume list

func WaitForContainer

func WaitForContainer(conn *synology.Connection, containerName, expectedState string, timeout time.Duration) error

WaitForContainer waits for a container to reach the expected state

func WaitForContainerState added in v0.2.2

func WaitForContainerState(conn *synology.Connection, containerName, expectedState string, timeout time.Duration) error

WaitForContainerState waits for container to reach specific state with timeout

Types

type CleanupManager

type CleanupManager struct {
	// contains filtered or unexported fields
}

CleanupManager manages cleanup of test resources

func NewCleanupManager

func NewCleanupManager(conn *synology.Connection) *CleanupManager

NewCleanupManager creates a new cleanup manager

func (*CleanupManager) AddContainer

func (cm *CleanupManager) AddContainer(name string)

AddContainer adds a container to cleanup list

func (*CleanupManager) AddDirectory

func (cm *CleanupManager) AddDirectory(path string)

AddDirectory adds a directory to cleanup list

func (*CleanupManager) AddFile

func (cm *CleanupManager) AddFile(path string)

AddFile adds a file to cleanup list

func (*CleanupManager) AddNetwork

func (cm *CleanupManager) AddNetwork(name string)

AddNetwork adds a network to cleanup list

func (*CleanupManager) AddVolume

func (cm *CleanupManager) AddVolume(name string)

AddVolume adds a volume to cleanup list

func (*CleanupManager) CleanupAll

func (cm *CleanupManager) CleanupAll() error

CleanupAll removes all tracked resources

func (*CleanupManager) CleanupContainers

func (cm *CleanupManager) CleanupContainers() error

CleanupContainers removes all tracked containers

func (*CleanupManager) CleanupDirectories

func (cm *CleanupManager) CleanupDirectories() error

CleanupDirectories removes all tracked directories

func (*CleanupManager) CleanupFiles

func (cm *CleanupManager) CleanupFiles() error

CleanupFiles removes all tracked files

func (*CleanupManager) CleanupNetworks

func (cm *CleanupManager) CleanupNetworks() error

CleanupNetworks removes all tracked networks

func (*CleanupManager) CleanupVolumes

func (cm *CleanupManager) CleanupVolumes() error

CleanupVolumes removes all tracked volumes

func (*CleanupManager) ForceCleanupContainers

func (cm *CleanupManager) ForceCleanupContainers() error

ForceCleanupContainers removes all containers with syno-docker test prefix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL