コード例 #1
0
func TestDockerbeatValidVersionMalformed(t *testing.T) {
	// GIVEN
	var versions = []string{"1.xD", "malformed", "1.5-testMalformed"}
	var beat = getEmptyDockerbeat()

	for _, version := range versions {
		// WHEN
		var valid, err = beat.validVersion(version)

		// THEN
		assert.False(t, valid)
		assert.NotNil(t, err)
	}
}
コード例 #2
0
func TestDockerbeatValidVersion(t *testing.T) {
	// GIVEN
	var versions = []string{"1.5.0", "1.5.3", "1.6.12", "1.8.2"}
	var beat = getEmptyDockerbeat()

	for _, version := range versions {
		// WHEN
		var valid, err = beat.validVersion(version)

		// THEN
		assert.True(t, valid)
		assert.Nil(t, err)
	}
}
コード例 #3
0
func TestDockerbeatValidVersionTooOld(t *testing.T) {
	// GIVEN
	var versions = []string{"1.3.0", "1.4.2", "1.4.9"}
	var beat = getEmptyDockerbeat()

	for _, version := range versions {
		// WHEN
		var valid, err = beat.validVersion(version)

		// THEN
		assert.False(t, valid)
		assert.Nil(t, err)
	}
}