Skip to content

Commit

Permalink
improve suite (#2964)
Browse files Browse the repository at this point in the history
Co-authored-by: Hare Sudhan <[email protected]>
  • Loading branch information
Biagio-Dipalma and cyberbuff authored Nov 12, 2024
1 parent b760512 commit ff52ae4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions atomics/T1562.003/T1562.003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ atomic_tests:
history -c
ls -la $HISTFILE # " ls -la $HISTFILE"
if [ $(history |wc -l) -eq 1 ]; then echo "ls -la is not in history cache"; fi
# -> ls -la is not in history cache
if [ "$HISTCONTROL" != "erasedups" ]; then export HISTCONTROL="erasedups"; fi
history -c
ls -la $HISTFILE
Expand All @@ -114,8 +113,10 @@ atomic_tests:
TEST=$(echo $HISTFILESIZE)
echo $HISTFILESIZE
export HISTFILESIZE=0
if [ $(echo $HISTFILESIZE) -eq 0 ]; then echo "\$HISTFILESIZE is zero"; fi
# -> $HISTFILESIZE is zero
echo "runnning some commands to populate the history"
whoami
groups
if [ $(echo $HISTFILESIZE) -eq 0 ]; then echo "\$HISTFILESIZE is zero"; else HIST_LENGHT=$(wc -l $HISTFILE); echo "\$HISTFILESIZE is not zero, history lenght is $HIST_LENGHT"; fi
cleanup_command: |
export HISTCONTROL=$(echo $TEST)
- name: Setting the HISTSIZE environment variable
Expand All @@ -132,8 +133,10 @@ atomic_tests:
command: |
echo $HISTSIZE
export HISTSIZE=0
if [ $(echo $HISTSIZE) -eq 0 ]; then echo "\$HISTSIZE is zero"; fi
# -> $HISTSIZE is zero
echo "runnning some commands to populate the history"
whoami
groups
if [ $(echo $HISTSIZE) -eq 0 ]; then echo "\$HISTSIZE is zero"; else HIST_LENGTH=$(wc -l $HISTFILE); echo "\$HISTSIZE is not zero, history size is $HIST_LENGTH"; fi
cleanup_command: |
export HISTSIZE=100
Expand All @@ -152,8 +155,10 @@ atomic_tests:
TEST=$(echo $HISTFILE)
echo $HISTFILE
export HISTFILE="/dev/null"
if [ $(echo $HISTFILE) == "/dev/null" ]; then echo "\$HISTFILE is /dev/null"; fi
# -> $HISTFILE is /dev/null
echo "runnning some commands to populate the history"
whoami
groups
if [ $(echo $HISTFILE) == "/dev/null" ]; then echo "\$HISTFILE is /dev/null"; else HIST_LENGHT=$(wc -l $HISTFILE); echo "\$HISTFILE is not /dev/null, history lenght is $HIST_LENGHT"; fi
cleanup_command: |
export HISTFILE=$(echo $TEST)
- name: Setting the HISTFILE environment variable (freebsd)
Expand All @@ -171,7 +176,6 @@ atomic_tests:
echo $HISTFILE
export HISTFILE="/dev/null"
if [ $(echo $HISTFILE) == "/dev/null" ]; then echo "\$HISTFILE is /dev/null"; fi
# -> $HISTFILE is /dev/null
cleanup_command: |
export HISTFILE=~/.sh_history
- name: Setting the HISTIGNORE environment variable
Expand Down

0 comments on commit ff52ae4

Please sign in to comment.