-
Notifications
You must be signed in to change notification settings - Fork 101
Add unreferenced file integration tests #1399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
spencerugbo
wants to merge
7
commits into
main
Choose a base branch
from
add-unreferenced-file-integration-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+479
−7
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
198ef67
add unreferenced file support to mock
spencerugbo dd3c21e
add integration tests for unreferenced files
spencerugbo ca4aada
address lint issues
spencerugbo ace57ea
add referenced to unreferenced test case
spencerugbo 4708acf
add manifest check to update and delete tests
spencerugbo 094d943
refactor test cases
spencerugbo db8c825
fix failing test case
spencerugbo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
372 changes: 372 additions & 0 deletions
372
test/integration/managementplane/config_apply_unreferenced_files_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,372 @@ | ||
| // Copyright (c) F5, Inc. | ||
| // | ||
| // This source code is licensed under the Apache License, Version 2.0 license found in the | ||
| // LICENSE file in the root directory of this source tree. | ||
|
|
||
| package managementplane | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "log/slog" | ||
| "os" | ||
| "sort" | ||
| "testing" | ||
|
|
||
| mpi "github.com/nginx/agent/v3/api/grpc/mpi/v1" | ||
| "github.com/nginx/agent/v3/internal/model" | ||
| "github.com/nginx/agent/v3/test/integration/utils" | ||
|
|
||
| "github.com/stretchr/testify/suite" | ||
| ) | ||
|
|
||
| const unrefConfigApplyRequestBody = `{ | ||
| "unreferencedFiles": [ | ||
| { | ||
| "file_meta": { | ||
| "name": "/etc/nginx/test/unreferenced_file.conf", | ||
| "permissions": "0600" | ||
| } | ||
| } | ||
| ] | ||
| }` | ||
|
|
||
| type ConfigApplyUnreferencedFilesTestSuite struct { | ||
| suite.Suite | ||
| ctx context.Context | ||
| teardownTest func(testing.TB) | ||
| nginxInstanceID string | ||
| mockManagementConfigDir string | ||
| } | ||
|
|
||
| func (s *ConfigApplyUnreferencedFilesTestSuite) SetupSuite() { | ||
| slog.Info("starting config apply with unreferenced files tests") | ||
| s.ctx = context.Background() | ||
| s.teardownTest = utils.SetupConnectionTest(s.T(), false, false, false, | ||
| "../../config/agent/nginx-config-with-grpc-client.conf") | ||
| s.nginxInstanceID = utils.VerifyConnection(s.T(), 2, utils.MockManagementPlaneAPIAddress) | ||
|
|
||
| s.mockManagementConfigDir = "/mock-management-plane-grpc/config/" + s.nginxInstanceID | ||
|
|
||
| responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) | ||
| s.Require().Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Require().Equal("Successfully updated all files", responses[0].GetCommandResponse().GetMessage()) | ||
| } | ||
|
|
||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TearDownSuite() { | ||
| slog.Info("finished config apply with unreferenced files tests") | ||
| s.teardownTest(s.T()) | ||
| } | ||
|
|
||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TearDownTest() { | ||
| utils.ClearManagementPlaneResponses(s.T(), utils.MockManagementPlaneAPIAddress) | ||
| } | ||
|
|
||
| // Config apply with unreferenced file in subdirectory | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test1_TestSubDirectory() { | ||
| slog.Info("starting config apply unreferenced file in sub directory test") | ||
|
|
||
| err := utils.MockManagementPlaneGrpcContainer.CopyFileToContainer( | ||
| s.ctx, | ||
| "configs/unreferenced_file.conf", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/test/unreferenced_file.conf", s.nginxInstanceID), | ||
| 0o600, | ||
| ) | ||
| s.Require().NoError(err) | ||
|
|
||
| utils.PerformConfigApplyWithRequestBody(s.T(), s.nginxInstanceID, | ||
| utils.MockManagementPlaneAPIAddress, unrefConfigApplyRequestBody) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 2, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
| manifestFiles["/etc/nginx/test/unreferenced_file.conf"] = &model.ManifestFile{ | ||
| ManifestFileMeta: &model.ManifestFileMeta{ | ||
| Name: "/etc/nginx/test/unreferenced_file.conf", | ||
| Hash: "ucNsmG0hN5ojrMVkQKveSGlt00uIaEkZ1rTDa1QNUY0=", | ||
| Size: 189, | ||
| Referenced: false, | ||
| }, | ||
| } | ||
|
|
||
| if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "/SWXYYenb2EcJNg6fiuzlkdj91nBdsMdF1vLm7Wybvc=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1218 | ||
| } | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| sort.Slice(responses, func(i, j int) bool { | ||
| return responses[i].GetCommandResponse().GetMessage() < responses[j].GetCommandResponse().GetMessage() | ||
| }) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[1].GetCommandResponse().GetStatus()) | ||
| s.Equal("Successfully updated all files", responses[1].GetCommandResponse().GetMessage()) | ||
| slog.Info("finished config apply unreferenced file in sub directory test") | ||
| } | ||
|
|
||
| // Config apply to update unreferenced file in DataPlane | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test2_TestUpdateUnreferencedInDataPlane() { | ||
| slog.Info("starting update unreferenced file in data plane test") | ||
|
|
||
| code, _, updateErr := utils.Container.Exec(s.ctx, []string{ | ||
| "sh", "-c", "echo '# Updated unreferenced file' >> /etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
|
|
||
| s.Require().NoError(updateErr) | ||
| s.Equal(0, code) | ||
|
|
||
| utils.PerformConfigApplyWithRequestBody(s.T(), s.nginxInstanceID, | ||
| utils.MockManagementPlaneAPIAddress, unrefConfigApplyRequestBody) | ||
|
|
||
| dataPlaneCode, dataPlaneFileContent, dataPlaneOutputErr := utils.Container.Exec(s.ctx, []string{ | ||
| "cat", "/etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
| s.Require().NoError(dataPlaneOutputErr) | ||
| s.Equal(0, dataPlaneCode) | ||
|
|
||
| mockCode, mockFileContent, mockOutputErr := utils.MockManagementPlaneGrpcContainer.Exec(s.ctx, []string{ | ||
| "cat", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/test/unreferenced_file.conf", s.nginxInstanceID), | ||
| }) | ||
| s.Require().NoError(mockOutputErr) | ||
| s.Equal(0, mockCode) | ||
|
|
||
| responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
|
|
||
| if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "/SWXYYenb2EcJNg6fiuzlkdj91nBdsMdF1vLm7Wybvc=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1218 | ||
| } | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
| s.NotEqual(dataPlaneFileContent, mockFileContent) | ||
| slog.Info("finished update unreferenced file in data plane test") | ||
| } | ||
|
|
||
| // Config apply to delete unreferenced file from DataPlane | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test3_TestDeleteUnreferencedInDataPlane() { | ||
| slog.Info("starting delete unreferenced file from data plane test") | ||
|
|
||
| code, _, removeErr := utils.Container.Exec(context.Background(), []string{ | ||
| "rm", | ||
| "/etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
|
|
||
| s.Require().NoError(removeErr) | ||
| s.Equal(0, code) | ||
|
|
||
| code, _, err := utils.Container.Exec(s.ctx, []string{ | ||
| "test", "-f", "/etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
| s.Require().NoError(err) | ||
| s.NotEqual(0, code) | ||
|
|
||
| utils.PerformConfigApplyWithRequestBody(s.T(), s.nginxInstanceID, | ||
| utils.MockManagementPlaneAPIAddress, unrefConfigApplyRequestBody) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
|
|
||
| if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "/SWXYYenb2EcJNg6fiuzlkdj91nBdsMdF1vLm7Wybvc=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1218 | ||
| } | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
|
|
||
| code, _, err = utils.Container.Exec(s.ctx, []string{ | ||
| "test", "-f", "/etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
| s.Require().NoError(err) | ||
| s.Equal(0, code) | ||
| slog.Info("finished delete unreferenced file from data plane test") | ||
| } | ||
|
|
||
| // Config apply to delete unreferenced file from Mock | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test4_TestDeleteUnreferencedFromMock() { | ||
| slog.Info("starting delete unreferenced file from mock test") | ||
|
|
||
| code, _, removeErr := utils.MockManagementPlaneGrpcContainer.Exec(context.Background(), []string{ | ||
| "rm", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/test/unreferenced_file.conf", s.nginxInstanceID), | ||
| }) | ||
|
|
||
| s.Require().NoError(removeErr) | ||
| s.Equal(0, code) | ||
|
|
||
| utils.PerformConfigApply(s.T(), s.nginxInstanceID, utils.MockManagementPlaneAPIAddress) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
| delete(manifestFiles, "/etc/nginx/test/unreferenced_file.conf") | ||
|
|
||
| if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "/SWXYYenb2EcJNg6fiuzlkdj91nBdsMdF1vLm7Wybvc=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1218 | ||
| } | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
|
|
||
| code, _, err := utils.MockManagementPlaneGrpcContainer.Exec(s.ctx, []string{ | ||
| "test", | ||
| "-f", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/test/unreferenced_file.conf", s.nginxInstanceID), | ||
| }) | ||
| s.Require().NoError(err) | ||
| s.NotEqual(0, code) | ||
|
|
||
| code, _, err = utils.Container.Exec(s.ctx, []string{ | ||
| "test", "-f", "/etc/nginx/test/unreferenced_file.conf", | ||
| }) | ||
| s.Require().NoError(err) | ||
| s.NotEqual(0, code) | ||
|
|
||
| slog.Info("finished delete unreferenced file from mock test") | ||
| } | ||
|
|
||
| // Config apply to change unreferenced file to referenced file | ||
spencerugbo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test5_TestUnreferencedToReferenced() { | ||
| slog.Info("starting unreferenced file to referenced file test") | ||
|
|
||
| err := utils.MockManagementPlaneGrpcContainer.CopyFileToContainer( | ||
| s.ctx, | ||
| "configs/unreferenced_file.conf", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/test/unreferenced_file.conf", s.nginxInstanceID), | ||
| 0o666, | ||
| ) | ||
| s.Require().NoError(err) | ||
|
|
||
| utils.PerformConfigApplyWithRequestBody(s.T(), s.nginxInstanceID, | ||
| utils.MockManagementPlaneAPIAddress, unrefConfigApplyRequestBody) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
| manifestFiles["/etc/nginx/test/unreferenced_file.conf"] = &model.ManifestFile{ | ||
| ManifestFileMeta: &model.ManifestFileMeta{ | ||
| Name: "/etc/nginx/test/unreferenced_file.conf", | ||
| Hash: "ucNsmG0hN5ojrMVkQKveSGlt00uIaEkZ1rTDa1QNUY0=", | ||
| Size: 189, | ||
| Referenced: false, | ||
| }, | ||
| } | ||
|
|
||
| if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "/SWXYYenb2EcJNg6fiuzlkdj91nBdsMdF1vLm7Wybvc=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1218 | ||
| } | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
| utils.WriteConfigFileMock(s.T(), s.nginxInstanceID, "/etc/nginx/test/unreferenced_file.conf", | ||
| "/etc/nginx/test/unreferenced_file.conf", "/etc/nginx/mime.types") | ||
|
|
||
| utils.ClearManagementPlaneResponses(s.T(), utils.MockManagementPlaneAPIAddress) | ||
| utils.PerformConfigApply(s.T(), s.nginxInstanceID, utils.MockManagementPlaneAPIAddress) | ||
| responses = utils.ManagementPlaneResponses(s.T(), 2, utils.MockManagementPlaneAPIAddress) | ||
|
|
||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "NIs0JY8C/mhUGfarLe28m3oQmeqc8+4MKXzLtWAgwGI=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1382 | ||
| manifestFiles["/etc/nginx/test/unreferenced_file.conf"].ManifestFileMeta.Referenced = true | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[1].GetCommandResponse().GetStatus()) | ||
| s.Equal("Successfully updated all files", responses[1].GetCommandResponse().GetMessage()) | ||
| slog.Info("finished unreferenced file to referenced file test") | ||
| } | ||
|
|
||
| // Config apply to change referenced file to unreferenced file | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test6_TestReferencedToUnreferenced() { | ||
| slog.Info("starting referenced file to unreferenced file test") | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
| utils.WriteConfigFileMock(s.T(), s.nginxInstanceID, "/etc/nginx/mime.types", | ||
| "/etc/nginx/mime.types", "/etc/nginx/mime.types") | ||
|
|
||
| utils.PerformConfigApply(s.T(), s.nginxInstanceID, utils.MockManagementPlaneAPIAddress) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 2, utils.MockManagementPlaneAPIAddress) | ||
|
|
||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Hash = "r+khc9eBiffYMXGIdkQ3CeGar4/MBzuMUkaSlcSXsOw=" | ||
| manifestFiles["/etc/nginx/nginx.conf"].ManifestFileMeta.Size = 1348 | ||
| manifestFiles["/etc/nginx/test/unreferenced_file.conf"].ManifestFileMeta.Referenced = false | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage()) | ||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[1].GetCommandResponse().GetStatus()) | ||
| s.Equal("Successfully updated all files", responses[1].GetCommandResponse().GetMessage()) | ||
| slog.Info("finished referenced file to unreferenced file test") | ||
| } | ||
|
|
||
| // Config apply with invalid config and unreferenced file to test rollback | ||
| func (s *ConfigApplyUnreferencedFilesTestSuite) TestConfigApply_Test7_TestRollbackWithUnreferencedFile() { | ||
| slog.Info("starting invalid config apply with unreferenced file test") | ||
|
|
||
| err := utils.MockManagementPlaneGrpcContainer.CopyFileToContainer( | ||
| s.ctx, | ||
| "../../config/nginx/invalid-nginx.conf", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/nginx.conf", s.nginxInstanceID), | ||
| 0o666, | ||
| ) | ||
| s.Require().NoError(err) | ||
|
|
||
| err = utils.MockManagementPlaneGrpcContainer.CopyFileToContainer( | ||
| s.ctx, | ||
| "./configs/unreferenced_file.conf", | ||
| fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/unreferenced_file.conf", s.nginxInstanceID), | ||
| 0o666, | ||
| ) | ||
| s.Require().NoError(err) | ||
|
|
||
| body := `{ | ||
| "unreferencedFiles": [ | ||
| { | ||
| "file_meta": { | ||
| "name": "/etc/nginx/unreferenced_file.conf", | ||
| "permissions": "0644" | ||
| } | ||
| } | ||
| ] | ||
| }` | ||
|
|
||
| utils.PerformConfigApplyWithRequestBody(s.T(), s.nginxInstanceID, utils.MockManagementPlaneAPIAddress, body) | ||
| responses := utils.ManagementPlaneResponses(s.T(), 2, utils.MockManagementPlaneAPIAddress) | ||
| s.T().Logf("Config apply responses: %v", responses) | ||
|
|
||
| manifestFiles := utils.GetManifestFiles() | ||
|
|
||
| utils.CheckManifestFile(s.T(), utils.Container, manifestFiles) | ||
|
|
||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_ERROR, responses[0].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply failed, rolling back config", responses[0].GetCommandResponse().GetMessage()) | ||
| s.Equal(configApplyErrorMessage, responses[0].GetCommandResponse().GetError()) | ||
| s.Equal(mpi.CommandResponse_COMMAND_STATUS_FAILURE, responses[1].GetCommandResponse().GetStatus()) | ||
| s.Equal("Config apply failed, rollback successful", responses[1].GetCommandResponse().GetMessage()) | ||
| s.Equal(configApplyErrorMessage, responses[1].GetCommandResponse().GetError()) | ||
| slog.Info("finished invalid config apply with unreferenced file test") | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this command doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this command to check file existence. The command would return an exit code which would be 0 if the file exists or 1 if the file doesn't exist and I used this code for the assertions