Skip to content

Fix: zapper_iot must define test_data issue#855

Open
kiya956 wants to merge 1 commit into
mainfrom
default_uname_passwd
Open

Fix: zapper_iot must define test_data issue#855
kiya956 wants to merge 1 commit into
mainfrom
default_uname_passwd

Conversation

@kiya956
Copy link
Copy Markdown
Collaborator

@kiya956 kiya956 commented Dec 23, 2025

We default use test_data username/password, while test_data is not defined, fallback to use provision_data username/password not just "ubunut"/"ubuntu"

Description

We default use test_data username/password, while test_data is not defined, fallback to use provision_data username/password not just "ubunut"/"ubuntu"

Resolved issues

Solving wrong userame/password while test_data is not defined.

Documentation

Web service API changes

Tests

  1. provision imx8mp-pdk with test_data is defined and verified username/password is correct
  2. provision imx8mp-pdk without test_data and verified that we fallback to use username/password in provision_data

@kiya956 kiya956 requested a review from a team as a code owner December 23, 2025 02:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.68%. Comparing base (accf330) to head (a9ad6ff).
⚠️ Report is 211 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
+ Coverage   71.38%   74.68%   +3.30%     
==========================================
  Files         108      111       +3     
  Lines        9674    11442    +1768     
  Branches      860      988     +128     
==========================================
+ Hits         6906     8546    +1640     
- Misses       2595     2690      +95     
- Partials      173      206      +33     
Flag Coverage Δ *Carryforward flag
agent 75.78% <ø> (+2.92%) ⬆️
cli 87.90% <ø> (ø) Carriedforward from accf330
device 65.37% <100.00%> (+10.15%) ⬆️
server 87.71% <ø> (ø) Carriedforward from accf330

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Agent 75.78% <ø> (+2.92%) ⬆️
CLI 87.90% <ø> (ø)
Common ∅ <ø> (∅)
Device Connectors 65.37% <100.00%> (+10.15%) ⬆️
Server 87.71% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

We default use test_data username/password, while test_data is not defined
fallback to use provision_data username/password but just "ubunut"/"ubuntu"

Signed-off-by: ChunAn Wu <an.wu@canonical.com>
@kiya956 kiya956 force-pushed the default_uname_passwd branch from d733160 to a9ad6ff Compare December 23, 2025 05:15
Copy link
Copy Markdown

@artiepoole artiepoole left a comment

Choose a reason for hiding this comment

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

Thank you @kiya956 , this seems to solve my problem exactly.

@p-gentili p-gentili self-requested a review January 7, 2026 07:57
Copy link
Copy Markdown
Contributor

@p-gentili p-gentili left a comment

Choose a reason for hiding this comment

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

This works well with provisioning but it will fail during the test phase, mostly because the username there defaults to ubuntu.

What's your use case @artiepoole ? Only provisioning?

@artiepoole
Copy link
Copy Markdown

artiepoole commented May 25, 2026

What's your use case @artiepoole ? Only provisioning?

Sorry, it has been a few months. I have this message I sent to An which lead to this PR:

Hey An,

[redacted]
can we change the default of "ubuntu" to provision_data's username? As it stands, the preset and the test_username do not match by default and I have to add

test_data:
test_username: 'ce-certification-qa@lists.canonical.com'
test_cmds: |
in order to stop this defaulting to ubuntu and mismatching when setting the username because of

  username = data.get("test_data", {}).get("test_username", "ubuntu")

and the error prints here:
[redacted]

I feel like, typically, the provision data's username/password is the same as the test username/password most of the time?

Which makes me think that the issue was with provisioning a device (a check was failing and so provisioning failed) attempting to do UC24 checkbox testing.

Note: I think I have installed this version on my devices and it has been working well, but they may have been updated since. Actually I do not know what version of testflinger is running on our agents. It seems like a workaround may have been added to the oemqa-ci repo to automatcally fix this when using envicorn

@p-gentili
Copy link
Copy Markdown
Contributor

Actually I do not know what version of testflinger is running on our agents. It seems like a workaround may have been added to the oemqa-ci repo to automatcally fix this when using envicorn

Ok, I guess we can close this PR for now. Ubuntu Core with console conf indeed requires the user to provide an email as username. Internally, we switched to system-user assertions. You guys might want to do the same.

@p-gentili p-gentili closed this May 25, 2026
@kiya956
Copy link
Copy Markdown
Collaborator Author

kiya956 commented May 26, 2026

@p-gentili Hi Paolo,
The purpose of this is for provision without define test_data. In PE, CE have a high probability that they only want to provision machines and debug it. And I don't think this could cause test phase fail if provision phase success.

And sorry, I don't get what this mean

 Internally, we switched to system-user assertions.

@p-gentili
Copy link
Copy Markdown
Contributor

Hey @kiya956, ok let's take care of that. Although, I'll need you to add a warning in case the username is different from test_username as defined below.

test_username = self.job_data.get("test_data", {}).get("test_username", "ubuntu")

A warning like:

Provisioning is using a username different from what the test phase expects, which may prevent it from accessing the DUT later on.

@p-gentili p-gentili reopened this Jun 1, 2026
@kiya956
Copy link
Copy Markdown
Collaborator Author

kiya956 commented Jun 2, 2026

Hey @kiya956, ok let's take care of that. Although, I'll need you to add a warning in case the username is different from test_username as defined below.

test_username = self.job_data.get("test_data", {}).get("test_username", "ubuntu")

A warning like:

Provisioning is using a username different from what the test phase expects, which may prevent it from accessing the DUT later on.

Hi @p-gentili I found I can not git push, would you like to grant me permission? Thanks

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.

3 participants