Documentation
¶
Index ¶
- func CheckContainerLogs(conn *synology.Connection, containerName, expectedLogContent string) error
- func CreateTestDirectory(conn *synology.Connection, path string) error
- func CreateTestFile(conn *synology.Connection, filePath, content string) error
- func CreateTestFileInContainer(conn *synology.Connection, containerName, filePath, content string) error
- func GetContainerIP(conn *synology.Connection, containerName string) (string, error)
- func RandomString(length int) string
- func ReadTestFileFromContainer(conn *synology.Connection, containerName, filePath string) (string, error)
- func TestContainerConnectivity(conn *synology.Connection, fromContainer, toContainer string, port int) error
- func TestHTTPEndpoint(url, expectedContent string, timeout time.Duration) error
- func VerifyImageExists(conn *synology.Connection, imageName string) (bool, error)
- func VerifyNetworkExists(conn *synology.Connection, networkName string) (bool, error)
- func VerifyVolumeExists(conn *synology.Connection, volumeName string) (bool, error)
- func WaitForContainer(conn *synology.Connection, containerName, expectedState string, ...) error
- func WaitForContainerState(conn *synology.Connection, containerName, expectedState string, ...) error
- type CleanupManager
- func (cm *CleanupManager) AddContainer(name string)
- func (cm *CleanupManager) AddDirectory(path string)
- func (cm *CleanupManager) AddFile(path string)
- func (cm *CleanupManager) AddNetwork(name string)
- func (cm *CleanupManager) AddVolume(name string)
- func (cm *CleanupManager) CleanupAll() error
- func (cm *CleanupManager) CleanupContainers() error
- func (cm *CleanupManager) CleanupDirectories() error
- func (cm *CleanupManager) CleanupFiles() error
- func (cm *CleanupManager) CleanupNetworks() error
- func (cm *CleanupManager) CleanupVolumes() error
- func (cm *CleanupManager) ForceCleanupContainers() error
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 ¶
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 ¶
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