@@ -437,6 +437,39 @@ func TestGetAzcopyJob(t *testing.T) {
437437 expectedPercent : "100.0" ,
438438 expectedErr : nil ,
439439 },
440+ {
441+ desc : "run exec parse azcopy job CompletedWithErrors" ,
442+ listStr : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithErrors\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
443+ listErr : nil ,
444+ enableShow : false ,
445+ showStr : "" ,
446+ showErr : nil ,
447+ expectedJobState : AzcopyJobCompletedWithErrors ,
448+ expectedPercent : "100.0" ,
449+ expectedErr : nil ,
450+ },
451+ {
452+ desc : "run exec parse azcopy job CompletedWithSkipped" ,
453+ listStr : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithSkipped\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
454+ listErr : nil ,
455+ enableShow : false ,
456+ showStr : "" ,
457+ showErr : nil ,
458+ expectedJobState : AzcopyJobCompletedWithSkipped ,
459+ expectedPercent : "100.0" ,
460+ expectedErr : nil ,
461+ },
462+ {
463+ desc : "run exec parse azcopy job CompletedWithErrorsAndSkipped" ,
464+ listStr : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithErrorsAndSkipped\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
465+ listErr : nil ,
466+ enableShow : false ,
467+ showStr : "" ,
468+ showErr : nil ,
469+ expectedJobState : AzcopyJobCompletedWithErrorsAndSkipped ,
470+ expectedPercent : "100.0" ,
471+ expectedErr : nil ,
472+ },
440473 {
441474 desc : "run exec get error in azcopy jobs show" ,
442475 listStr : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: InProgress\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
@@ -535,6 +568,27 @@ func TestParseAzcopyJobList(t *testing.T) {
535568 expectedJobState : AzcopyJobCompleted ,
536569 expectedErr : nil ,
537570 },
571+ {
572+ desc : "parse azcopy job CompletedWithErrors" ,
573+ str : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithErrors\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
574+ expectedJobid : "" ,
575+ expectedJobState : AzcopyJobCompletedWithErrors ,
576+ expectedErr : nil ,
577+ },
578+ {
579+ desc : "parse azcopy job CompletedWithSkipped" ,
580+ str : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithSkipped\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
581+ expectedJobid : "" ,
582+ expectedJobState : AzcopyJobCompletedWithSkipped ,
583+ expectedErr : nil ,
584+ },
585+ {
586+ desc : "parse azcopy job CompletedWithErrorsAndSkipped" ,
587+ str : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: CompletedWithErrorsAndSkipped\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
588+ expectedJobid : "" ,
589+ expectedJobState : AzcopyJobCompletedWithErrorsAndSkipped ,
590+ expectedErr : nil ,
591+ },
538592 {
539593 desc : "parse azcopy job InProgress" ,
540594 str : "JobId: ed1c3833-eaff-fe42-71d7-513fb065a9d9\n Start Time: Monday, 07-Aug-23 03:29:54 UTC\n Status: InProgress\n Command: copy https://{accountName}.file.core.windows.net/{srcFileshare}{SAStoken} https://{accountName}.file.core.windows.net/{dstFileshare}{SAStoken} --recursive --check-length=false" ,
0 commit comments