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

can not save logs in login phase #2587

Open
guazhang opened this issue Jan 2, 2024 · 1 comment
Open

can not save logs in login phase #2587

guazhang opened this issue Jan 2, 2024 · 1 comment

Comments

@guazhang
Copy link

guazhang commented Jan 2, 2024

after one case finished, maybe we need save some logs.
now I try to add login step to do that but I found var TMT_TEST_DATA don't find in the phase.

so could we plan to support the function ?

 login -s execute -c "rhts-submit-log -l /var/log/messages" 
[guazhang@dhcp-131-247 plan]$ tree
.
├── data
│   └── variables.env
├── discover
│   ├── step.yaml
│   └── tests.yaml
├── execute
│   ├── data
│   │   └── guest
│   │       └── default-0
│   │           └── tests
│   │               └── reboot-1
│   │                   ├── ASSERT_STATUSES
│   │                   ├── clbuff
│   │                   ├── cleanup.sh
│   │                   ├── data
│   │                   ├── journal_colored.txt
│   │                   ├── journal.meta
│   │                   ├── journal.txt
│   │                   ├── journal.xml
│   │                   ├── metadata.yaml
│   │                   ├── output.txt
│   │                   ├── PersistentData
│   │                   ├── PHASE_STATUSES
│   │                   ├── TestResults
│   │                   ├── tmt-test-topology.sh
│   │                   └── tmt-test-topology.yaml
│   ├── results.yaml
│   └── step.yaml
├── finish
│   └── step.yaml
├── prepare
│   └── step.yaml
├── provision
│   ├── guests.yaml
│   └── step.yaml
└── report
    └── step.yaml

           00:00:02 pass /tests/reboot (on default-0) [1/1]

        Copy '/var/tmp/tmt/run-005/default/plan/data' from the guest to '/'.
        
        execute task #2: login on default-0
        login: Starting interactive shell
        Push workdir to guest 'storageqe-100.rhts.eng.pek2.redhat.com'.
        Run 'rhts-submit-log -l /var/log/messages' in interactive mode.
        Execute command 'export TMT_PLAN_DATA=/var/tmp/tmt/run-005/default/plan/data; export TMT_PLAN_ENVIRONMENT_FILE=/var/tmp/tmt/run-005/default/plan/data/variables.env; export TMT_TREE=/var/tmp/tmt/run-005/default/plan/tree; export TMT_VERSION=1.30.0; cd /var/tmp/tmt/run-005/default/plan/tree; rhts-submit-log -l /var/log/messages' on guest 'storageqe-100.rhts.eng.pek2.redhat.com'.
Warning: Permanently added 'storageqe-100.rhts.eng.pek2.redhat.com' (ED25519) to the list of known hosts.
/usr/local/bin/rhts-submit-log: line 31: TMT_TEST_DATA: unbound variable
Connection to storageqe-100.rhts.eng.pek2.redhat.com closed.
        login: Interactive shell finished
    
        summary: 1 test executed
    report
    workdir: /var/tmp/tmt/run-005/default/plan/report
        how: display
            pass /tests/reboot
        summary: 1 test passed
    finish

@lukaszachy
Copy link
Collaborator

'TMT_TEST_DATA' is available only when test is executed (or login -t). Should we use TMT_PLAN_DATA when https://tmt.readthedocs.io/en/stable/stories/features.html#save-a-log-file is used outside of the test?

Downside is that the risk of name conflicts will be high - we might need to check for that and rename submitted files.

@idorax idorax removed their assignment May 31, 2024
@psss psss removed the enhancement label Sep 17, 2024
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

No branches or pull requests

4 participants