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

Update fcopy related cases for Check-FileInLinuxGuest command #175

Merged
merged 1 commit into from
May 9, 2019

Conversation

lixuemin2016
Copy link
Contributor

@lixuemin2016 lixuemin2016 commented May 6, 2019

Original Check-FileInLinuxGuest has bugs when migration from lis-test to lisav2.
Details update lists as below:

  1. Separate check-size and check-content, before use sts[-1], sts[0], now change to sts
  2. Before without return $False if file does not exist
  3. Out-File $testfile -Encoding UTF8 to avoid mess code, before use dos2unix.
  4. Add parse parmeter FilesSize
  5. Fix Run-LinuxCmd without output for $sts if only use "rm -f file"
    $sts = Run-LinuxCmd -username $VMUserName -password $VMPassword -port $VMPort -ip $Ipv4 "rm -f /mnt/test/$testfile" -runAsSudo
  6. Change "File is not present" as "File check error", since when file is empty, it will get file size 0, but the file is present.

Have run all the TestTag fcopy cases, all the cases are passed. Before update, FCOPY-REPEATED-DELETE and FCOPY-OVERWRITE failed.

Thank you so much.

Copy link
Contributor

@chvalean chvalean left a comment

Choose a reason for hiding this comment

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

Small comments added, thank you for the improvements!

Testscripts/Windows/FCOPY-REPEATED-DELETE.ps1 Outdated Show resolved Hide resolved
Testscripts/Windows/FCOPY-REPEATED-DELETE.ps1 Outdated Show resolved Hide resolved
@@ -32,6 +32,17 @@ $gsi = $null
# Main body script
#
#######################################################################

# Read parameters
Copy link
Contributor

Choose a reason for hiding this comment

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

if you add TestParams parsing directly to Main, then this section is no longer required.
Please check sample code here:
https://github.com/LIS/LISAv2/blob/master/Testscripts/Windows/SETUP-Remove-NVME-Disk.ps1#L48

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your guidance, new method is very convenient.

@chvalean chvalean added the enhancement New feature or request label May 6, 2019
@lixuemin2016
Copy link
Contributor Author

lixuemin2016 commented May 8, 2019

Add new changes here, maybe better put the new change to new commit.

  1. Change some "Return "PASS"" location in the scripts, before it Return "Pass" before Remove-Item in server file.
  2. Check Remove-Item -Path \$HVServer\ return value, use ($? -ne "True") to check remove successfully or not, even (- not $?) also can check, in order to keep consistent, use same style
  3. Remove call trace check in the FCOPY-DISABLE-ENABLE case, since already cover by log checking in the framework.
  4. FCOPY-NEGATIVE case also has some issues, will update it tomorrow.

@juhlee-microsoft
Copy link
Contributor

@lixuemin2016 @chvalean please follow up the change if needed further discussion. Or, sign off please.

@chvalean chvalean merged commit 5078f34 into microsoft:master May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants