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

Allow fw update for other boot type against on the previous "none" boot fw update #2040

Merged
merged 11 commits into from
Apr 29, 2022

Conversation

sujinmkang
Copy link
Collaborator

@sujinmkang sujinmkang commented Jan 25, 2022

sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924

What I did

Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

How I did it

Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

How to verify it

  1. Run fwutil update all for boot_type="none"
  2. Run fwutil update all for any other boot_type
  3. Verify if the 2nd update is proceeded.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@sujinmkang sujinmkang changed the title Allow fwutil update all for other boot type if any previous fw update done for "none" boot type Allow fw update for other boot type against on the previous "none" boot fw update Jan 25, 2022
@dgsudharsan
Copy link
Collaborator

@alexrallen @nazariig Can you please help review?

Copy link
Contributor

@alexrallen alexrallen left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes! All looks good to me except one question I would like you to take a look at.

fwutil/lib.py Outdated
data = self.read_au_status_file_if_exists(FW_AU_STATUS_FILE_PATH)
if data is not None:
boot_type = list(data.keys())[0]
if boot_type is "none" and boot_type is not boot:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why boot_type is not boot?

This seems intended to prevent a user from consecutively running a "none" boot but I believe that should be possible.

@alexrallen
Copy link
Contributor

Also @sujinmkang does this PR fix sonic-net/sonic-buildimage#8924 ? It looks like it might.

I also might suggest fixing sonic-net/sonic-buildimage#8923 while you are in this code too if you want to handle all the fwutil issues I raised in a single pass (up to you totally, just worth mentioning)

Copy link
Contributor

@alexrallen alexrallen left a comment

Choose a reason for hiding this comment

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

See comments please. Thanks.

fwutil/lib.py Outdated
data = self.read_au_status_file_if_exists(FW_AU_STATUS_FILE_PATH)
if data is not None:
if boot is "none" or boot in data:
click.echo("Allow firmware auto-update {} again on top of the previous {} reboot".format(boot, boot_type))
Copy link
Contributor

Choose a reason for hiding this comment

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

Has this been manually tested? Do we have any unit tests for this?

boot_type is not defined in this latest change as far as I can tell.

alexrallen
alexrallen previously approved these changes Feb 11, 2022
Copy link
Contributor

@alexrallen alexrallen left a comment

Choose a reason for hiding this comment

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

Code looks good to me as long as this has been tested.

@liat-grozovik
Copy link
Collaborator

/azp run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dgsudharsan
Copy link
Collaborator

@sujinmkang Can you please sync to the latest? vs tests have been removed and will not run in sonic-utilities. You may also have to add tests for code coverage.

@dprital
Copy link
Collaborator

dprital commented Apr 26, 2022

@qiluo-msft - as discussed, please approve this PR. Thanks.

@qiluo-msft
Copy link
Contributor

Please add unit test. The coverage checker fails.

@qiluo-msft qiluo-msft merged commit fdb79b8 into sonic-net:master Apr 29, 2022
judyjoseph pushed a commit that referenced this pull request May 2, 2022
…ot fw update (#2040)

sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924

#### What I did
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How I did it
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type

#### How to verify it
1. Run fwutil update all for boot_type="none"
2. Run fwutil update all for any other boot_type
3. Verify if the 2nd update is proceeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants