Skip to content

Conversation

@shjala
Copy link
Member

@shjala shjala commented Sep 17, 2025

Should fo after lf-edge/eve#4502

@shjala shjala requested a review from uncleDecart as a code owner September 17, 2025 12:47
@shjala shjala force-pushed the vcom.test.updated branch 3 times, most recently from 6729627 to d436ba5 Compare September 25, 2025 13:54
@shjala shjala force-pushed the vcom.test.updated branch 2 times, most recently from 52ac6ac to 656a66e Compare September 29, 2025 15:37
@shjala
Copy link
Member Author

shjala commented Sep 29, 2025

@milan-zededa Milan, can you help me find out what is wrong with my test, this test was working before but now when I try to ssh to the application I just get "failed to dial: dial tcp 127.0.0.1:8027: connect: connection refused".

I haven't changed anything before the ssh establishes, new code is after that, but it just can't ssh to the app anymore, anything I can check on eve side to make sure it forwarding the port properly? also I don't see qemu listening on 8027 in EVE:

08a8860e-0586-4e34-a135-f4f33277f1f9:~# netstat -ntuple
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 10.11.12.1:53           0.0.0.0:*               LISTEN      5663/dnsmasq
tcp        0      0 10.11.12.1:80           0.0.0.0:*               LISTEN      2254/zedbox
tcp        0      0 0.0.0.0:8877            0.0.0.0:*               LISTEN      2357/ptpm
tcp        0      0 0.0.0.0:4822            0.0.0.0:*               LISTEN      1955/guacd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1912/sshd -D -e [li
tcp        0      0 127.0.0.1:41495         0.0.0.0:*               LISTEN      1826/containerd
tcp        0      0 :::9100                 :::*                    LISTEN      2123/node_exporter
tcp        0      0 :::22                   :::*                    LISTEN      1912/sshd -D -e [li
udp        0      0 10.11.12.1:53           0.0.0.0:*                           5663/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           5663/dnsmasq
udp        0      0 192.168.0.10:68         0.0.0.0:*                           3976/dhcpcd: eth0 [
udp        0      0 192.168.0.11:68         0.0.0.0:*                           3989/dhcpcd: eth1 [
udp        0      0 fe80::183f:f6d1:64ae:6e0b:546 :::*                                3976/dhcpcd: eth0 [
udp        0      0 fe80::b1f4:c4cd:a282:15c9:546 :::*                                3989/dhcpcd: eth1 [
08a8860e-0586-4e34-a135-f4f33277f1f9:~# 

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zpaett from Eden test issues causing failures, there is a failure which I assume the PR should fix:
--- FAIL: TestVcomLinkTpmRequestEK (0.02s)

@milan-zededa
Copy link
Contributor

@shjala How do you run the test locally? I tried to run it with:

make clean && make build-tests
./eden config add default
./eden config set default --key=eve.tpm --value=true
./eden setup
export EDEN_TEST_SETUP=y
./eden test ./tests/workflow -s virtualization.tests.txt -v debug

And it fails due to the SSH issue. However, everything is then deleted so I cannot investigate:

eden pod ps
NAME	IMAGE	UUID	INTERNAL	EXTERNAL	MEMORY	STATE(ADAM)	LAST_STATE(EVE)
eden network ls
NAME	UUID	TYPE	CIDR	STATS	STATE(ADAM)	LAST_STATE(EVE)
eden volume ls
NAME	UUID	REF	IMAGE	TYPE	SIZE	MAX_SIZE	MOUNT	STATE(ADAM)	LAST_STATE(EVE)

Is it possible to stop this cleanup from happening?

@shjala
Copy link
Member Author

shjala commented Sep 30, 2025

Zpaett from Eden test issues causing failures, there is a failure which I assume the PR should fix: --- FAIL: TestVcomLinkTpmRequestEK (0.02s)

@eriknordmark yes, the test script works fine when I test it manually, but for some reason golang code can't ssh to the app anymore, I'm working on a fix.

@shjala
Copy link
Member Author

shjala commented Sep 30, 2025

@shjala How do you run the test locally? I tried to run it with:

This is my eden setup:

make clean
make build
make build-tests
./eden config add default
./eden config set default --key eve.tag --value 0.0.0-master-cbe92311
./eden config set default --key eve.tpm --value true
./eden setup
./eden start
./eden eve onboard

Is it possible to stop this cleanup from happening?

what do need? I can change the code for sure.

@shjala
Copy link
Member Author

shjala commented Sep 30, 2025

@milan-zededa I think I find out what is the issue, App ssh port is 22, instead of 8027 I set in the config, I'm not sure why this is not working anymore and defaults to 22:

shah in 🌐 shah-MS-7E12 in eden on  HEAD (61ece17) [!?] via 🐹 v1.25.0 
❯ ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no -i ./dist/default-certs/id_rsa root@localhost -p 2222
EVE is Edge Virtualization Engine

Take a look around and don't forget to use eve(1).
fe4b5537-598d-4082-84a2-5b17cf615fff:~# eve enter debug
[debug] root@fe4b5537-598d-4082-84a2-5b17cf615fff:/$ ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no [email protected]
[email protected]'s password: 
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-144-generic x86_64)
ubuntu@734ff871-328a-4639-ac5f-9886cc1949f7:~$                                                                                   

ignore this.

@shjala
Copy link
Member Author

shjala commented Sep 30, 2025

@milan-zededa my bad I forgot for add port forwarding for 8027, this setup works:

./eden config set default --key eve.hostfwd --value '{"2222":"22","8027":"8027"}'

and test passes :

shah in 🌐 shah-MS-7E12 in eden/tests/vcom on  vcom.test.updated [?] via 🐹 v1.25.0 via 🐍 v3.12.3 
❯ EDEN_CONFIG=default ./eden.vcom.test -test.v
time: 2025-09-30T13:13:10.803339302+02:00 out: VCOM Test started
[...]
time: 2025-09-30T13:13:44.227736401+02:00 out: App vcomlink-crazy_volhard state changed to: RUNNING
    vcom_test.go:39: time: 2025-09-30T13:13:44.227741751+02:00 out: Waiting for ssh to be ready...
        
    vcom_test.go:39: time: 2025-09-30T13:14:06.093097351+02:00 out: SSH connection with VM established.
        
    vcom_test.go:39: time: 2025-09-30T13:14:06.093132962+02:00 out: Installing python3-protobuf...
        
    vcom_test.go:39: time: 2025-09-30T13:14:31.216101285+02:00 out: Copying test scripts to the vm...
        
    vcom_test.go:39: time: 2025-09-30T13:14:31.433955866+02:00 out: Testing TPM Get Public Key via vComLink...
        
    vcom_test.go:39: time: 2025-09-30T13:14:31.555972892+02:00 out: Processing vComLink<->VM response...
        
    vcom_test.go:39: time: 2025-09-30T13:14:31.556009632+02:00 out: Output: Testing TPM Get Public Key via VSOCK HTTP...
        Sending TPM GetPub request via VSOCK (CID: 2, Port: 2000)...
        TPM EK: 0001000b000300b20020837197674484...
        TPM EK Algorithm: 1
        TPM EK Attributes: FlagFixedTPM | FlagFixedParent | FlagSensitiveDataOrigin | FlagAdminWithPolicy | FlagRestricted | FlagDecrypt
        
        Test passed!
        
        
    vcom_test.go:39: time: 2025-09-30T13:14:31.556039282+02:00 out: TestvComLinkTpmRequestEK passed
        
config changed, to see config run 'eden controller edge-node get-config'
DEBU[0080] VersionIncrement 12->13                      
DEBU[0081] config updated /home/shah/.eden/devUUID-5270b90f-4a3c-45b3-bc46-c21ee6917091.json 
DEBU[0081] state updated /home/shah/.eden/state-55f94170-39a2-425f-9e25-60382a97b295.yml 
INFO[0081] app vcomlink-crazy_volhard stop done         
config changed, to see config run 'eden controller edge-node get-config'
DEBU[0081] VersionIncrement 13->14                      
DEBU[0082] config updated /home/shah/.eden/devUUID-5270b90f-4a3c-45b3-bc46-c21ee6917091.json 
DEBU[0082] state updated /home/shah/.eden/state-55f94170-39a2-425f-9e25-60382a97b295.yml 
INFO[0082] app vcomlink-crazy_volhard delete done       
    vcom_test.go:39: time: 2025-09-30T13:14:33.611025494+02:00 out: TestvComLinkTpmRequestEK finished
        
--- PASS: TestVcomLinkTpmRequestEK (82.80s)
PASS

Copy link
Member

@uncleDecart uncleDecart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shjala
Copy link
Member Author

shjala commented Sep 30, 2025

It works locally, fails in CI :

❯ ./eden test ./tests/workflow -s virtualization.tests.txt -v debug
configName:  default
configFile:  /home/shah/.eden/contexts/default.yml
DEBU[0000] DIR: ./tests/workflow                        
DEBU[0000] testScenario:virtualization.tests.txt        
DEBU[0000] Will use config from /home/shah/.eden/contexts/default.yml 
DEBU[0000] Try to add config from /mnt/nvme0n1p5/dev/eden/tests/workflow/eden-config.yml 
DEBU[0000] Merged config with /mnt/nvme0n1p5/dev/eden/tests/workflow/eden-config.yml 
DEBU[0000] testApp: eden+ports.sh                       
DEBU[0000] testProg: /data/dev/eden/dist/bin/eden+ports.sh 
DEBU[0000] Test: /data/dev/eden/dist/bin/eden+ports.sh 2223:2223 2224:2224 5912:5902 5911:5901 8027:8027 8028:8028 8029:8029 8030:8030 8031:8031 
DEBU[0000] TestArgsEnv: ' -test.v'                      
2223:2223
{"2222":"22","8027":"8027"}
Adding "2223":"2223" port redirection to EDEN config
2224:2224
{"2222":"22","8027":"8027"}
Adding "2224":"2224" port redirection to EDEN config
5912:5902
{"2222":"22","8027":"8027"}
Adding "5912":"5902" port redirection to EDEN config
5911:5901
{"2222":"22","8027":"8027"}
Adding "5911":"5901" port redirection to EDEN config
8027:8027
8028:8028
{"2222":"22","8027":"8027"}
Adding "8028":"8028" port redirection to EDEN config
8029:8029
{"2222":"22","8027":"8027"}
Adding "8029":"8029" port redirection to EDEN config
8030:8030
{"2222":"22","8027":"8027"}
Adding "8030":"8030" port redirection to EDEN config
8031:8031
{"2222":"22","8027":"8027"}
Adding "8031":"8031" port redirection to EDEN config
eden config set default --key eve.hostfwd --value '{"2222":"22","8027":"8027","2223":"2223","2224":"2224","5912":"5902","5911":"5901","8028":"8028","8029":"8029","8030":"8030","8031":"8031"}'
INFO[0000] Current context is: default                  
eden config get default --key eve.hostfwd
{"2222":"22","2223":"2223","2224":"2224","5911":"5901","5912":"5902","8027":"8027","8028":"8028","8029":"8029","8030":"8030","8031":"8031"}
To activate the changes in the config, you need to restart EVE:
  eden eve stop
  eden eve start
DEBU[0000] testApp: /bin/echo                           
DEBU[0000] testProg: /bin/echo                          
DEBU[0000] Test: /bin/echo EVE VcomLink tests (12/12)   
DEBU[0000] TestArgsEnv: ' -test.v'                      
EVE VcomLink tests (12/12)
DEBU[0000] testApp: eden.escript.test                   
DEBU[0000] testProg: /data/dev/eden/dist/bin/eden.escript.test 
DEBU[0000] Test: /data/dev/eden/dist/bin/eden.escript.test -test.run TestEdenScripts/eden_vcom 
DEBU[0000] TestArgsEnv: ' -test.v'                      
=== RUN   TestEdenScripts
INFO[0000] testData directory: testdata                 
=== RUN   TestEdenScripts/eden_vcom
=== PAUSE TestEdenScripts/eden_vcom
=== CONT  TestEdenScripts/eden_vcom
> test eden.vcom.test
testProg: /data/dev/eden/dist/bin/eden.vcom.test timewait: 0s



    testscript.go:420: 
        WORK=$WORK
        PATH=/home/shah/.vscode-server/bin/0f0d87fa9e96c856c5212fc86db137ac0d783365/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/shah/.local/bin:/home/shah/.vscode-server/data/User/globalStorage/github.copilot-chat/debugCommand:/usr/local/go/bin:/home/shah/.local/bin
        DOCKER_HOST=
        DOCKER_CONFIG=/home/shah/.docker
        TMPDIR=$WORK/tmp
        devnull=/dev/null
        /=/
        :=:
        EDEN_CONFIG=default
        HOME=/no-home
        exe=
        
        > test eden.vcom.test
        testProg: /data/dev/eden/dist/bin/eden.vcom.test
        [stdout]
        time: 2025-09-30T15:32:39.663668111+02:00 out: VCOM Test started
        configName:  default
        configFile:  /home/shah/.eden/contexts/default.yml
        time="2025-09-30T15:32:39+02:00" level=debug msg="Will use config from /home/shah/.eden/contexts/default.yml"
        time="2025-09-30T15:32:39+02:00" level=debug msg="Try to add config from $WORK/eden-config.yml"
        time="2025-09-30T15:32:39+02:00" level=debug msg="new datastore created 815e4bb9-3e04-41ef-b6ff-5236459fcf21"
        time="2025-09-30T15:32:39+02:00" level=info msg="Starting download of image from https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
        time="2025-09-30T15:32:39+02:00" level=info msg="Start download into eserver of ubuntu-22.04-server-cloudimg-amd64.img"
        time="2025-09-30T15:32:39+02:00" level=info msg="Image downloaded with size 677 MB and sha256 b119a978dcb66194761674c23a860a75cdb7778e95e222b51d7a3386dfe3c920"
 [...]
        time="2025-09-30T15:34:05+02:00" level=info msg="app vcomlink-laughing_hellman delete done"
        PASS
        [stderr]
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
        Someone could be eavesdropping on you right now (man-in-the-middle attack)!
        It is also possible that a host key has just been changed.
        The fingerprint for the ED25519 key sent by the remote host is
        SHA256:TuP3dNmblpDULKPu2lKrEEvOHcBwk7CUAnBjVdlQvR0.
        Please contact your system administrator.
        Add correct host key in /home/shah/.ssh/known_hosts to get rid of this message.
        Offending ECDSA key in /home/shah/.ssh/known_hosts:17
          remove with:
          ssh-keygen -f '/home/shah/.ssh/known_hosts' -R '[127.0.0.1]:2222'
        Password authentication is disabled to avoid man-in-the-middle attacks.
        Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
        UpdateHostkeys is disabled because the host key is not trusted.
        PASS
        
--- PASS: TestEdenScripts (0.00s)
    --- PASS: TestEdenScripts/eden_vcom (86.13s)
PASS

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.

4 participants