aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Segundo2023-12-31 00:49:58 +0100
committerChristian Segundo2023-12-31 12:00:02 +0100
commitc5f325e580540d81903360920094aafcc6ad4008 (patch)
treee20b666c71b912bb4103a2421b3ca2d547f16328
parentdf2b48edbb77e40dbd93e1c097b0b1cacde8a74a (diff)
downloadlanguagetool-c5f325e580540d81903360920094aafcc6ad4008.tar.gz
add goss
-rw-r--r--Dockerfile12
-rw-r--r--goss.yaml3
-rw-r--r--tests/command.yaml13
-rw-r--r--tests/http.yaml34
-rw-r--r--tests/package.yaml6
-rw-r--r--tests/process.yaml4
-rw-r--r--tests/user.yaml8
7 files changed, 75 insertions, 5 deletions
diff --git a/Dockerfile b/Dockerfile
index f138778..9ad4fd5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,6 +2,12 @@ FROM openjdk:slim
ARG VERSION=6.3
+WORKDIR /home/languagetool
+
+RUN adduser \
+ --home /home/languagetool \
+ --no-create-home languagetool
+
SHELL ["/bin/bash", "-eufo", "pipefail", "-c"]
# hadolint ignore=DL3008
@@ -14,16 +20,12 @@ RUN apt-get update && \
bsdtar -x -f - && \
rm -rf /var/lib/apt/lists/*
-RUN adduser \
- --home /LanguageTool-$VERSION \
- --no-create-home languagetool
-
COPY --chown=languagetool misc/init.sh /
COPY --chown=languagetool misc/ngram.sh /
-WORKDIR /LanguageTool-$VERSION
HEALTHCHECK --timeout=10s --start-period=5s \
CMD curl --fail --data "language=en-US&text=healthcheck test" http://localhost:8010/v2/check || exit 1
CMD [ "bash", "/init.sh" ]
+WORKDIR /home/languagetool/LanguageTool-$VERSION
USER languagetool
EXPOSE 8010
diff --git a/goss.yaml b/goss.yaml
new file mode 100644
index 0000000..398de7d
--- /dev/null
+++ b/goss.yaml
@@ -0,0 +1,3 @@
+---
+gossfile:
+ tests/*.yaml: {}
diff --git a/tests/command.yaml b/tests/command.yaml
new file mode 100644
index 0000000..69133ef
--- /dev/null
+++ b/tests/command.yaml
@@ -0,0 +1,13 @@
+---
+command:
+ 'curl --version':
+ exit-status: 0
+ stderr: []
+ stdout:
+ - curl
+
+ 'bsdtar --version':
+ exit-status: 0
+ stderr: []
+ stdout:
+ - bsdtar
diff --git a/tests/http.yaml b/tests/http.yaml
new file mode 100644
index 0000000..45aa2bb
--- /dev/null
+++ b/tests/http.yaml
@@ -0,0 +1,34 @@
+---
+http:
+ http://0.0.0.0:8010/v2/info:
+ status: 200
+ url: http://0.0.0.0:8010/v2/info
+ no-follow-redirects: true
+ timeout: 10000
+ method: GET
+ body:
+ - '{"software":{"name":"LanguageTool"'
+
+ http://0.0.0.0:8010/v2/languages:
+ status: 200
+ url: http://0.0.0.0:8010/v2/languages
+ no-follow-redirects: true
+ timeout: 10000
+ method: GET
+ request-headers:
+ - "accept: application/json"
+ body:
+ - '{"name":"Arabic","code":"ar","longCode":"ar"}'
+
+ http://0.0.0.0:8010/v2/check:
+ status: 200
+ url: http://0.0.0.0:8010/v2/check
+ no-follow-redirects: true
+ timeout: 10000
+ method: POST
+ request-headers:
+ - "accept: application/json"
+ - "content-type: application/x-www-form-urlencoded"
+ request-body: 'text=hello%20woorld&language=en-US&motherTongue=de-DE&enabledOnly=false'
+ body:
+ - This sentence does not start with an uppercase letter
diff --git a/tests/package.yaml b/tests/package.yaml
new file mode 100644
index 0000000..bcc88f7
--- /dev/null
+++ b/tests/package.yaml
@@ -0,0 +1,6 @@
+---
+package:
+ curl:
+ installed: true
+ libarchive-tools:
+ installed: true
diff --git a/tests/process.yaml b/tests/process.yaml
new file mode 100644
index 0000000..2d08c86
--- /dev/null
+++ b/tests/process.yaml
@@ -0,0 +1,4 @@
+---
+process:
+ java:
+ running: true
diff --git a/tests/user.yaml b/tests/user.yaml
new file mode 100644
index 0000000..5da4197
--- /dev/null
+++ b/tests/user.yaml
@@ -0,0 +1,8 @@
+---
+user:
+ languagetool:
+ exists: true
+ groups:
+ - languagetool
+ home: /home/languagetool
+ shell: /bin/bash