Skip to content

Commit ac57949

Browse files
committed
[otl] Fix build error due to container issue
1 parent f903d38 commit ac57949

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

mulog-opentelemetry/test/com/brunobonacci/mulog/publishers/open_telemetry_test.clj

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@
3939

4040

4141

42+
(defn- change-permissions
43+
"Grant access to all, required because optel process starts with a different user
44+
in the docker container. The userid inside the container is 10001"
45+
[f]
46+
(java.nio.file.Files/setPosixFilePermissions
47+
(.toPath (io/file f))
48+
#{java.nio.file.attribute.PosixFilePermission/OWNER_READ
49+
java.nio.file.attribute.PosixFilePermission/OWNER_WRITE
50+
java.nio.file.attribute.PosixFilePermission/OWNER_EXECUTE
51+
java.nio.file.attribute.PosixFilePermission/GROUP_READ
52+
java.nio.file.attribute.PosixFilePermission/GROUP_WRITE
53+
java.nio.file.attribute.PosixFilePermission/GROUP_EXECUTE
54+
java.nio.file.attribute.PosixFilePermission/OTHERS_READ
55+
java.nio.file.attribute.PosixFilePermission/OTHERS_WRITE
56+
java.nio.file.attribute.PosixFilePermission/OTHERS_EXECUTE }))
57+
58+
4259
(defn service-ready?
4360
[host port client-settings]
4461
(fn []
@@ -238,6 +255,7 @@
238255
(def test-id (f/flake))
239256
(def test-dir (str "/tmp/optel-" test-id))
240257
(io/make-parents (io/file (str test-dir "/test")))
258+
(change-permissions test-dir)
241259
(io/copy (io/file "./test-config.yml") (io/file (str test-dir "/config.yml")))
242260

243261
(def container (-> (tc/create
@@ -378,8 +396,8 @@
378396
:rdt/finalize
379397
;; stop publisher
380398
(publisher)
381-
(tc/stop! container)
382-
(rm-fr test-dir))
399+
(rm-fr test-dir)
400+
(tc/stop! container))
383401

384402

385403

@@ -388,6 +406,7 @@
388406
(def test-id (f/flake))
389407
(def test-dir (str "/tmp/optel-" test-id))
390408
(io/make-parents (io/file (str test-dir "/test")))
409+
(change-permissions test-dir)
391410
(io/copy (io/file "./test-config.yml") (io/file (str test-dir "/config.yml")))
392411

393412
(def container (-> (tc/create
@@ -514,5 +533,5 @@
514533
:rdt/finalize
515534
;; stop publisher
516535
(publisher)
517-
(tc/stop! container)
518-
(rm-fr test-dir))
536+
(rm-fr test-dir)
537+
(tc/stop! container))

0 commit comments

Comments
 (0)