Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zafl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
zafl
Commits
82952838
Commit
82952838
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Add functional tests
parent
f3875e00
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gzip/test_gzip.sh
+73
-0
73 additions, 0 deletions
test/gzip/test_gzip.sh
with
73 additions
and
0 deletions
test/gzip/test_gzip.sh
0 → 100755
+
73
−
0
View file @
82952838
TMP_FILE_1
=
/tmp/gzip.tmp.
$$
TMP_FILE_2
=
/tmp/gzip.tmp.
$$
cleanup
()
{
rm
-fr
/tmp/gzip.tmp
*
gzip
*
.zafl peasoup_exec
*
.gzip
*
}
log_error
()
{
echo
"FAIL:
$1
"
cleanup
exit
1
}
log_message
()
{
echo
"
$1
"
}
log_success
()
{
echo
"PASS:
$1
"
}
setup
()
{
echo
"hello"
>
$TMP_FILE_1
echo
"hello"
>
$TMP_FILE_2
}
build_zafl
()
{
gzip_zafl
=
$1
shift
$PSZ
`
which
gzip
`
$gzip_zafl
-c
move_globals
=
on
-c
zafl
=
on
-o
move_globals:--elftables
$*
if
[
!
$?
-eq
0
]
;
then
log_error
"
$gzip_zafl
: unable to generate Zafl version"
else
log_message
"
$gzip_zafl
: built successfully"
fi
}
test_zafl
()
{
LD_LIBRARY_PATH
=
$LD_LIBRARY_PATH
:
$SECURITY_TRANSFORMS_HOME
/lib/
$1
$TMP_FILE_1
if
[
!
$?
-eq
0
]
;
then
log_error
"
$1
: unable to gzip file using zafl"
fi
gunzip
${
TMP_FILE_1
}
.gz
diff
$TMP_FILE_1
$TMP_FILE_2
if
[
$?
-eq
0
]
;
then
log_success
"
$1
: after unzipping, we get the same file back. yeah!"
else
log_error
"
$1
: after unzipping, we get a diferent file"
fi
}
pushd
/tmp
setup
build_zafl gzip.nostars.zafl
test_zafl ./gzip.nostars.zafl
cleanup
setup
build_zafl gzip.zafl
test_zafl ./gzip.zafl
cleanup
log_success
"all tests passed"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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