Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gitlab Pages
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
What's new
5
Snippets
Groups
Projects
gitlab-org
Gitlab Pages
Commits
28ba807f
Commit
28ba807f
authored
7 years ago
by
Jacob Vosmaer
Browse files
Options
Downloads
Patches
Plain Diff
Capture status quo in tests
parent
7667ad88
Branches
deployer
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
internal/deploy/extractzip_test.go
+18
-0
18 additions, 0 deletions
internal/deploy/extractzip_test.go
internal/deploy/testdata/.gitignore
+1
-0
1 addition, 0 deletions
internal/deploy/testdata/.gitignore
internal/deploy/testdata/test3.zip
+0
-0
0 additions, 0 deletions
internal/deploy/testdata/test3.zip
with
19 additions
and
0 deletions
internal/deploy/extractzip_test.go
+
18
−
0
View file @
28ba807f
...
...
@@ -32,6 +32,24 @@ func TestExtractZip(t *testing.T) {
return
err
==
ErrNoPublicFiles
},
},
{
desc
:
"archive with evil symlink"
,
archive
:
"testdata/test3.zip"
,
mustExist
:
map
[
string
]
string
{
// The test3.zip archive contains a symlink to /etc/passwd. This test
// asserts that instead of that symlink, we get a regular file whose
// contents are "/etc/passwd". If the extracted "public/passwd" was an
// actual symlink we would get the contents of the /etc/passwd file of
// the system where the test runs.
"public/passwd"
:
"/etc/passwd"
,
// The "public/bar" symlink tries to point to "foo" but we don't support
// symlinks at the moment. Instead it creates a regular file with
// contents "bar". TODO: support valid symlinks?
"public/bar"
:
"foo"
,
// "foo" is a regular file with contents "not-bar"
"public/foo"
:
"not-bar
\n
"
,
},
},
}
for
_
,
tc
:=
range
testCases
{
...
...
This diff is collapsed.
Click to expand it.
internal/deploy/testdata/.gitignore
0 → 100644
+
1
−
0
View file @
28ba807f
/public
This diff is collapsed.
Click to expand it.
internal/deploy/testdata/test3.zip
0 → 100644
+
0
−
0
View file @
28ba807f
File added
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment