Skip to content

Commit

Permalink
Merge branch 'assignment8' into assignment9
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalkes committed Aug 28, 2024
2 parents 21907d9 + a9d1044 commit db89587
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: assignment-test
on: [push]
on:
push:
tags-ignore:
- '*'
branches:
- '*'
jobs:
unit-test:
container: cuaesd/aesd-autotest:assignment7
container: cuaesd/aesd-autotest:24-unit-test
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
Expand All @@ -11,7 +16,7 @@ jobs:
- name: Run unit test
run: ./unit-test.sh
full-test:
container: cuaesd/aesd-autotest:assignment7
container: cuaesd/aesd-autotest:24-assignment7
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The basis of the automated test implementation for this repository comes from [h

The assignment-autotest directory contains scripts useful for automated testing Use
```
git submodule init update --recursive
git submodule update --init --recursive
```
to synchronize after cloning and before starting each assignment, as discussed in the assignment instructions.

Expand Down
30 changes: 20 additions & 10 deletions finder-app/finder-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WRITESTR=AELD_IS_FUN
WRITEDIR=/tmp/aeld-data
username=$(cat conf/username.txt)

if [ $# -lt 2 ]
if [ $# -lt 3 ]
then
echo "Using default value ${WRITESTR} for string to write"
if [ $# -lt 1 ]
Expand All @@ -22,25 +22,32 @@ then
else
NUMFILES=$1
WRITESTR=$2
WRITEDIR=/tmp/aeld-data/$3
fi

MATCHSTR="The number of files are ${NUMFILES} and the number of matching lines are ${NUMFILES}"

echo "Writing ${NUMFILES} files containing string ${WRITESTR} to ${WRITEDIR}"

rm -rf "${WRITEDIR}"
mkdir -p "$WRITEDIR"

#The WRITEDIR is in quotes because if the directory path consists of spaces, then variable substitution will consider it as multiple argument.
#The quotes signify that the entire string in WRITEDIR is a single string.
#This issue can also be resolved by using double square brackets i.e [[ ]] instead of using quotes.
if [ -d "$WRITEDIR" ]
# create $WRITEDIR if not assignment1
assignment=`cat ../conf/assignment.txt`

if [ $assignment != 'assignment1' ]
then
echo "$WRITEDIR created"
else
exit 1
fi
mkdir -p "$WRITEDIR"

#The WRITEDIR is in quotes because if the directory path consists of spaces, then variable substitution will consider it as multiple argument.
#The quotes signify that the entire string in WRITEDIR is a single string.
#This issue can also be resolved by using double square brackets i.e [[ ]] instead of using quotes.
if [ -d "$WRITEDIR" ]
then
echo "$WRITEDIR created"
else
exit 1
fi
fi
#echo "Removing the old writer utility and compiling as a native application"
#make clean
#make
Expand All @@ -52,6 +59,9 @@ done

OUTPUTSTRING=$(./finder.sh "$WRITEDIR" "$WRITESTR")

# remove temporary directories
rm -rf /tmp/aeld-data

set +e
echo ${OUTPUTSTRING} | grep "${MATCHSTR}"
if [ $? -eq 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion finder-app/manual-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -u

OUTDIR=/tmp/aeld
KERNEL_REPO=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
KERNEL_VERSION=v5.1.10
KERNEL_VERSION=v5.15.163
BUSYBOX_VERSION=1_33_1
FINDER_APP_DIR=$(realpath $(dirname $0))
ARCH=arm64
Expand Down

0 comments on commit db89587

Please sign in to comment.