Skip to content

Commit

Permalink
v1.7.1 (#49)
Browse files Browse the repository at this point in the history
## v1.7.1
|||
|---|---|
|Date|2023-10-11
|Kind| BUGFIX release
|Author|[email protected],
- **BUGFIX**
  - Fixed a bug in the ETP & EAA CLI that prevented ULS to run properly in docker environment
    - [docker] bumped CLI-EAA to "0.6.3"
    - [docker] bumped CLI-ETP version to "0.4.5"
- **Housekeeping**
  - Added additional automated testing to the docker release process
  • Loading branch information
MikeSchiessl authored Oct 11, 2023
1 parent 9896496 commit 2efdc34
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ARG HOMEDIR="/opt/akamai-uls"
ARG ULS_DIR="$HOMEDIR/uls"
ARG EXT_DIR="$ULS_DIR/ext"

ARG ETP_CLI_VERSION="0.4.4"
ARG EAA_CLI_VERSION="0.6.2"
ARG ETP_CLI_VERSION="0.4.5"
ARG EAA_CLI_VERSION="0.6.3"
ARG MFA_CLI_VERSION="0.1.1"
ARG GC_CLI_VERSION="v0.0.2(beta)"
ARG LINODE_CLI_VERSION="dev"
Expand Down
2 changes: 1 addition & 1 deletion bin/config/global_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# Common global variables / constants
__version__ = "1.7.0"
__version__ = "1.7.1"
__tool_name_long__ = "Akamai Unified Log Streamer"
__tool_name_short__ = "ULS"

Expand Down
13 changes: 13 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Version History
## v1.7.1
|||
|---|---|
|Date|2023-10-11
|Kind| BUGFIX release
|Author|[email protected],
- **BUGFIX**
- Fixed a bug in the ETP & EAA CLI that prevented ULS to run properly in docker environment
- [docker] bumped CLI-EAA to "0.6.3"
- [docker] bumped CLI-ETP version to "0.4.5"
- **Housekeeping**
- Added additional automated testing to the docker release process

## v1.7.0
|||
|---|---|
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/kubernetes/helm/akamai-uls/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: Akamai Universal Log Streamer Helm installation

type: application
version: 2.0.0
appVersion: "1.7.0"
appVersion: "1.7.1"
103 changes: 103 additions & 0 deletions test/docker_test.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/env bats

## THIS Should be run from ULS ROOT DIR

# Variables
# ULS Binary
uls_bin=bin/uls.py

# Should we using a mocked edgerc (TRUE/FALSE) ?
mocked_edgerc=FALSE

# TIMEOUT
# How much time is timeout alklowed to run
uls_test_timeout=10
# Send a kill signal after
uls_kill_timeout=15
# Used for regular timeout
uls_timeout_signal="TERM"
uls_timeout_params=" --preserve-status --kill-after $uls_kill_timeout --signal ${uls_timeout_signal} ${uls_test_timeout} "

### Switch between mocked and real edgerc
if [ "$mocked_edgerc"=="FALSE" ] ; then
# REAL EDGERC FILE
uls_edgerc=~/.edgerc
uls_section=akamaidemo


# Variables
eaa_access_assert="username"
eaa_devinv_assert="client_version"
etp_assert="configId"
gc_assert="flow_id"
linode_assert=""
jmespath_assert="['"
else
# TESTING EDGERC FILE & section
uls_edgerc=test/_mocked_edgerc
uls_section=testing
# Variables
eaa_access_assert=""
eaa_devinv_assert=""
etp_assert=""
gc_assert=""
linode_assert=""
jmespath_assert=""
fi


# Load support libs
load 'bats/bats-support/load.bash'
load 'bats/bats-assert/load.bash'

# DOCKER TESTING

## Make sure everything is tidy and clean after every test ;)
teardown () {
docker stop uls-bats-test && docker rm uls-bats-test
return 0
}

## CREATE a local DOCKER IMAGE
@test "DOCKER IMAGE BUILD" {
run docker build -t uls:bats .
[ "$status" -eq 0 ]
}

## RUN AN EAA TEST
@test "DOCKER EAA TEST" {
run timeout ${uls_timeout_params} docker run --rm --name "uls-bats-test" --mount type=bind,source="${uls_edgerc}",target="/opt/akamai-uls/.edgerc",readonly uls:bats --section ${uls_section} --input eaa --feed access --output raw --loglevel info
assert_line --partial "UlsInputCli - started PID"
refute_line --partial "was found stale -"
#[ "$status" -eq 0 ]
}

## RUN AN ETP TEST
@test "DOCKER ETP TEST" {
run timeout ${uls_timeout_params} docker run --rm --name "uls-bats-test" --mount type=bind,source="${uls_edgerc}",target="/opt/akamai-uls/.edgerc",readonly uls:bats --section ${uls_section} --input etp --feed threat --output raw --loglevel info
assert_line --partial "UlsInputCli - started PID"
refute_line --partial "was found stale -"
#[ "$status" -eq 0 ]
}

## RUN AN MFA TEST
@test "DOCKER MFA TEST" {
run timeout ${uls_timeout_params} docker run --rm --name "uls-bats-test" --mount type=bind,source="${uls_edgerc}",target="/opt/akamai-uls/.edgerc",readonly uls:bats --section ${uls_section} --input mfa --feed event --output raw --loglevel info
assert_line --partial "UlsInputCli - started PID"
refute_line --partial "was found stale -"
#[ "$status" -eq 0 ]
}

## RUN AN GC TEST
@test "DOCKER GC TEST" {
run timeout ${uls_timeout_params} docker run --rm --name "uls-bats-test" --mount type=bind,source="${uls_edgerc}",target="/opt/akamai-uls/.edgerc",readonly uls:bats --section ${uls_section} --input gc --feed netlog --output raw --loglevel info
assert_line --partial "UlsInputCli - started PID"
refute_line --partial "was found stale -"
#[ "$status" -eq 0 ]
}

## REMOVE the local DOCKER IMAGE
@test "DOCKER IMAGE BUILD" {
docker image rm uls:bats
[ "$status" -eq 0 ]
}
4 changes: 2 additions & 2 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# test.sh [file - $tests_available] [regex merge]
tests_available="basic positive negative "
tests_available="basic positive negative docker "
parallel_tests=20



function do_test() {
if [ -f "test/$1_test.bats" ] ; then
echo -e "$1 TESTING\n"
if [ ${parallel_tests} -gt 1 ] ; then
if [ ${parallel_tests} -gt 1 ] && [ ${1} != "docker" ]; then
bats --jobs ${parallel_tests} test/$1_test.bats $filter
else
bats test/$1_test.bats $filter
Expand Down

0 comments on commit 2efdc34

Please sign in to comment.