Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JBEE-257] Add an script to run the Standalone Jakarta Mail TCK #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yersan
Copy link
Collaborator

@yersan yersan commented Oct 11, 2022

Jira issue: https://issues.redhat.com/browse/JBEE-257

A basic configuration to run the standalone TCK locally for Jakarta Mail API

CC @scottmarlow

@scottmarlow
Copy link

I built maven project and started tck script locally. Will see how that works and then review change.

@scottmarlow
Copy link

Hmm, maybe I need root access:

Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 15
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container

@scottmarlow
Copy link

scottmarlow commented Oct 11, 2022

Still see:

Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 1
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 2
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 3

I guess it doesn't have to work for me.

Some tests passed:
[javatest.batch] Test results: passed: 157; failed: 164

@yersan
Copy link
Collaborator Author

yersan commented Oct 11, 2022

@scottmarlow thanks for reviewing it, I had the container cached and I did not find that issue. Could you try again?

@scottmarlow
Copy link

@scottmarlow thanks for reviewing it, I had the container cached and I did not find that issue. Could you try again?

Should I run as root or non-root?

I'm running as root when getting:

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/4: FROM linagora/james-jpa-sample:3.0.1
STEP 2/4: ADD launch.sh /root
--> Using cache 8c522493b92533ccf2d023ad0378d88f2d8f97af0414fb1fb460fa957d94bea1
--> 8c522493b92
STEP 3/4: RUN chgrp -R 0 /root /logs /var &&     chmod -R g=u /root /logs /var &&     chmod +x /root/launch.sh &&     sed -i s/:143/:1143/g /root/conf/imapserver.xml &&     sed -i s/:993/:1993/g /root/conf/imapserver.xml &&     sed -i s/:110/:1110/g /root/conf/pop3server.xml &&     sed -i s/:25/:1025/g /root/conf/smtpserver.xml &&     sed -i s/:465/:1465/g /root/conf/smtpserver.xml &&     sed -i s/:587/:1587/g /root/conf/smtpserver.xml
error running container: error from /usr/bin/crun creating container for [/bin/sh -c chgrp -R 0 /root /logs /var &&     chmod -R g=u /root /logs /var &&     chmod +x /root/launch.sh &&     sed -i s/:143/:1143/g /root/conf/imapserver.xml &&     sed -i s/:993/:1993/g /root/conf/imapserver.xml &&     sed -i s/:110/:1110/g /root/conf/pop3server.xml &&     sed -i s/:25/:1025/g /root/conf/smtpserver.xml &&     sed -i s/:465/:1465/g /root/conf/smtpserver.xml &&     sed -i s/:587/:1587/g /root/conf/smtpserver.xml]: sd-bus call: Transport endpoint is not connected: Transport endpoint is not connected
: exit status 1
ERRO[0000] did not get container create message from subprocess: EOF 
Error: error building at STEP "RUN chgrp -R 0 /root /logs /var &&     chmod -R g=u /root /logs /var &&     chmod +x /root/launch.sh &&     sed -i s/:143/:1143/g /root/conf/imapserver.xml &&     sed -i s/:993/:1993/g /root/conf/imapserver.xml &&     sed -i s/:110/:1110/g /root/conf/pop3server.xml &&     sed -i s/:25/:1025/g /root/conf/smtpserver.xml &&     sed -i s/:465/:1465/g /root/conf/smtpserver.xml &&     sed -i s/:587/:1587/g /root/conf/smtpserver.xml": error while running runtime: exit status 1
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Trying to pull docker.io/jakartaee/wfly-tck-mailserver:1.0...
Error: initializing source docker://jakartaee/wfly-tck-mailserver:1.0: reading manifest 1.0 in docker.io/jakartaee/wfly-tck-mailserver: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

Waiting for mail server to be ready ................. 0
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 1
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 2
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 3
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 4
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 5
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 6
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for 

@scottmarlow
Copy link

Perhaps I need to delete images locally:

podman images
REPOSITORY                                           TAG         IMAGE ID      CREATED         SIZE
<none>                                               <none>      646b0be2a8f8  6 minutes ago   814 MB
localhost/jakartaee/wfly-tck-mailserver              1.0         0d2f6ec7e95a  13 minutes ago  957 MB
<none>                                               <none>      e0a93e32eb4b  2 months ago    957 MB
localhost/standalone-jakarta-xml-bind-tck-4.0-image  latest      1b0b5f4af0b4  4 months ago    2.73 GB
registry.fedoraproject.org/fedora                    latest      3a66698e6040  5 months ago    169 MB
registry.fedoraproject.org/fedora                    35          750037c05cfe  7 months ago    159 MB
registry.centos.org/centos                           latest      2f3766df23b6  22 months ago   217 MB
docker.io/library/postgres                           9.4         ed5a45034282  2 years ago     259 MB
docker.io/linagora/james-jpa-sample                  3.0.1       fe88cbdf8e17  4 years ago     814 MB

@yersan
Copy link
Collaborator Author

yersan commented Oct 11, 2022

Should I run as root or non-root?

non-root worked fine for me

You could check the files generated at /tmp/standalone-tck

The script creates the Dockerfile to build the cts-mailserver container.

These are the steps to build it: https://github.com/jboss/jakarta-mail/pull/2/files#diff-37fc6d0c2a80bf705c9788d89d49e8ebfa5e17796a5fc085d1e402622ac6358fR161-R197

@scottmarlow
Copy link

I removed all of my local podman images and ran again (as non-root after remove /tmp/standalone-tck folder, got:

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/4: FROM linagora/james-jpa-sample:3.0.1
Resolved "linagora/james-jpa-sample" as an alias (/home/smarlow/.cache/containers/short-name-aliases.conf)
Trying to pull docker.io/linagora/james-jpa-sample:3.0.1...
Getting image source signatures
Copying blob sha256:5040bd2983909aa8896b9932438c3f1479d25ae837a5f6220242a264d0221f2d
Copying blob sha256:11f7af24ed9cf47597dd6cf9963bb3e9109c963f0135e869a9e9b4999fdc12a3
Copying blob sha256:60170fec2151d2108ed1420625c51138434ba4e0223d3023353d3f32ffe3cfc2
Copying blob sha256:fce5728aad85a763fe3c419db16885eb6f7a670a42824ea618414b8fb309ccde
Copying blob sha256:76610ec20bf5892e24cebd4153c7668284aa1d1151b7c3b0c7d50c579aa5ce75
Copying blob sha256:e98f73de8f0d2ef292f58b004d67bc6e9ee779dcfaff7ebb3964649d4787b872
Copying blob sha256:49e2d6393f32abb1de7c9395c04c822ceb2287383d5a90998f7bd8dbfd43d48c
Copying blob sha256:bb9cdec9c7f337940f7d872274353b66e118412cbfd433c711361bcf7922aea4
Copying blob sha256:56c11d2dd2bb34716b622444daf58f4109d273f04f124770f3d01112ddd82d51
Copying blob sha256:8435a42a0faf800b1688fdde1627a0d0c84c2f57e64bffd9f869ff8cc7f3e53f
Copying blob sha256:94b9b7a2ef777bf8e466234f3f1da0df69f94156bc09b40841168d465ce14351
Copying blob sha256:26fa4eec2a5eb874d0abcaae82da9b038a826ff63d62fb2412a754052249506c
Copying blob sha256:24f7fca6384ca27891f98b3745e87c4efb7216a81a17cb3a07cb654e6f7d34c1
Copying blob sha256:dd9ab0977386f608b81c1a11c3bafe9b03e84693b2762a122e569dedc4c4707a
Copying blob sha256:5e4b3dd06e02d7b750df35e54d204b5d35207807bbf3530f3583aa0e51cc3ffc
Copying blob sha256:e96ac690b03d0b631e4f6675003af22f80e2e1a4b04f6710d6d9367304d006e5
Copying blob sha256:814435d512d515cc0484d426b1f1af4787e135ea889c7b510ef552351ee8be6e
Copying blob sha256:29315df93e7e3d3360c33f8b0c75b72f3e096948f28b8fe0e8c4ccb73d6b9506
Copying blob sha256:472b91f4c29d030f07066cea19671adcdfd0729213af26a955f156422a673caf
Copying blob sha256:707e86eca289cf8f51bd93d7194241798a6f6883e57a501377a6776cd0f38d38
Copying blob sha256:202a604cefc8ef257bb077d50e58fd3b2f0d0e048ba346955b63c72ad265aa1a
Copying config sha256:fe88cbdf8e17c0f505be8a2e5888daf19aa5a81a6a4f7dfb70c07b8444880898
Writing manifest to image destination
Storing signatures
STEP 2/4: ADD launch.sh /root
--> 30f08eddd7e
STEP 3/4: RUN chgrp -R 0 /root /logs /var &&     chmod -R g=u /root /logs /var &&     chmod +x /root/launch.sh &&     sed -i s/:143/:1143/g /root/conf/imapserver.xml &&     sed -i s/:993/:1993/g /root/conf/imapserver.xml &&     sed -i s/:110/:1110/g /root/conf/pop3server.xml &&     sed -i s/:25/:1025/g /root/conf/smtpserver.xml &&     sed -i s/:465/:1465/g /root/conf/smtpserver.xml &&     sed -i s/:587/:1587/g /root/conf/smtpserver.xml
--> f6586df714e
STEP 4/4: ENTRYPOINT ["/root/launch.sh"]
COMMIT jakartaee/wfly-tck-mailserver:1.0
--> 85c0c231fc0
Successfully tagged localhost/jakartaee/wfly-tck-mailserver:1.0
85c0c231fc0860685cc544c3459fe832c12d6bc8df2f4152830bfd3202873dd9
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Trying to pull docker.io/jakartaee/wfly-tck-mailserver:1.0...
Error: initializing source docker://jakartaee/wfly-tck-mailserver:1.0: reading manifest 1.0 in docker.io/jakartaee/wfly-tck-mailserver: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

Waiting for mail server to be ready ................. 0
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
Waiting for mail server to be ready ................. 1
.
.
.
Waiting for mail server to be ready ................. 30
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: no container with name or ID "cts-mailserver" found: no such container
javac fpopulate.java
CLASSPATH=/tmp/standalone-tck/libs/angus-activation.jar:/tmp/standalone-tck/libs/jakarta.activation-api.jar:/tmp/standalone-tck/libs/angus-mail.jar:/tmp/standalone-tck/libs/jakarta.mail-api.jar:./:
run java fpopulate
Couldn't connect to host, port: , 1143; timeout -1
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: , 1143; timeout -1;
  nested exception is:
        java.net.ConnectException: Connection refused (Connection refused)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:717)
        at jakarta.mail.Service.connect(Service.java:342)
        at jakarta.mail.Service.connect(Service.java:222)
        at jakarta.mail.Service.connect(Service.java:171)
        at fpopulate.main(fpopulate.java:94)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at java.base/java.net.Socket.connect(Socket.java:558)
        at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:357)
        at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:236)
        at com.sun.mail.iap.Protocol.<init>(Protocol.java:109)
        at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:133)
        at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:740)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:675)
        ... 4 more
.
.
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants