Exemplo n.º 1
0
        public void GetTestBuildImage_Validate_InvalidTag()
        {
            // Arrange
            var imageBaseValue = string.Empty;
            var tagSuffixValue = string.Empty;
            var imageHelper    = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue);

            // Assert
            Assert.Throws <NotSupportedException>(() => { imageHelper.GetBuildImage("invalidTag"); });
        }
Exemplo n.º 2
0
        public void OutOfTheBox_PlatformToolsSupportedByOryx_ShouldBeChosen_InFullBuildImage(
            string executableName,
            string expectedPathPrefix)
        {
            // Arrange
            var script = new ShellScriptBuilder()
                         .AddCommand($"which {executableName}")
                         .ToString();

            // Act
            var image  = _imageHelper.GetBuildImage();
            var result = _dockerCli.Run(image, "/bin/bash", "-c", script);

            // Assert
            RunAsserts(
                () =>
            {
                Assert.True(result.IsSuccess);
                Assert.Contains(expectedPathPrefix, result.StdOut);
            },
                result.GetDebugInfo());
        }
Exemplo n.º 3
0
        public void GetTestBuildImage_Validate_LatestVersionsTag()
        {
            // Arrange
            var imageBaseValue = string.Empty;
            var tagSuffixValue = string.Empty;
            var imageHelper    = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue);

            // Act
            var buildImage = imageHelper.GetBuildImage(_ltsVersionsTag);

            // Assert
            var expectedImage = $"{_defaultImageBase}/{_buildRepository}:{_ltsVersionsTag}";

            Assert.Equal(expectedImage, buildImage);
        }
Exemplo n.º 4
0
        public void GetTestBuildImage_Validate_ImageBaseSet()
        {
            // Arrange
            var imageBaseValue = "oryxtest";
            var tagSuffixValue = string.Empty;
            var imageHelper    = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue);

            // Act
            var buildImage = imageHelper.GetBuildImage();

            // Assert
            var expectedImage = $"{imageBaseValue}/{_buildRepository}:{_latestTag}";

            Assert.Equal(expectedImage, buildImage);
        }
Exemplo n.º 5
0
        public void GetTestBuildImage_Validate_TagSuffixSet()
        {
            // Arrange
            var imageBaseValue = string.Empty;
            var tagSuffixValue = "-buildNumber";
            var imageHelper    = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue);

            // Act
            var buildImage = imageHelper.GetBuildImage();

            // Assert
            var expectedTag   = tagSuffixValue.TrimStart('-');
            var expectedImage = $"{_defaultImageBase}/{_buildRepository}:{expectedTag}";

            Assert.Equal(expectedImage, buildImage);
        }