diff --git a/configs/test/gce/windows-init.ps1 b/configs/test/gce/windows-init.ps1 index 87893ed5fb..20f7b4cb2b 100755 --- a/configs/test/gce/windows-init.ps1 +++ b/configs/test/gce/windows-init.ps1 @@ -276,7 +276,7 @@ $fileName = "$tmp\clusterfuzz.zip" if ($env:USE_GCLOUD_STORAGE_CP -eq "1") { gcloud storage cp gs://$deploymentBucket/windows-3.zip $fileName } else { - gsutil cp gs://$deploymentBucket/windows-3.zip $fileName + gcloud storage cp gs://$deploymentBucket/windows-3.zip $fileName } unzip $fileName @@ -314,4 +314,3 @@ Write-Host "Run scripts" c:\autologin.bat c:\PsExec.exe \\$hostName -accepteula -h -i 0 -username `""$domain\$username"`" -password `""$password"`" c:\startup.bat - diff --git a/docker/base/setup_clusterfuzz.sh b/docker/base/setup_clusterfuzz.sh index 8e18e48ea9..5676f4360d 100644 --- a/docker/base/setup_clusterfuzz.sh +++ b/docker/base/setup_clusterfuzz.sh @@ -42,7 +42,7 @@ else if [ "$USE_GCLOUD_STORAGE_CP" = "1" ]; then gcloud storage cp gs://$DEPLOYMENT_BUCKET/$DEPLOYMENT_ZIP $CLUSTERFUZZ_FILE else - gsutil cp gs://$DEPLOYMENT_BUCKET/$DEPLOYMENT_ZIP $CLUSTERFUZZ_FILE + gcloud storage cp gs://$DEPLOYMENT_BUCKET/$DEPLOYMENT_ZIP $CLUSTERFUZZ_FILE fi unzip -q -o $CLUSTERFUZZ_FILE fi diff --git a/src/clusterfuzz/_internal/tests/core/fuzzing/corpus_manager_test.py b/src/clusterfuzz/_internal/tests/core/fuzzing/corpus_manager_test.py index a29a437920..14a2e6eb37 100644 --- a/src/clusterfuzz/_internal/tests/core/fuzzing/corpus_manager_test.py +++ b/src/clusterfuzz/_internal/tests/core/fuzzing/corpus_manager_test.py @@ -65,16 +65,16 @@ def test_rsync_to_disk(self, _): self.assertTrue(corpus.rsync_to_disk('/dir', timeout=60)) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', '-o', 'GSUtil:parallel_thread_count=16', - '-q', 'rsync', '-r', '-d', 'gs://bucket/', '/dir' + '/gsutil_path/gcloud', 'storage', 'rsync', '--recursive', + '--delete-unmatched-destination-objects', 'gs://bucket/', '/dir' ]) self.mock.cpu_count.return_value = 2 corpus = corpus_manager.GcsCorpus('bucket') self.assertTrue(corpus.rsync_to_disk('/dir', timeout=60)) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', '-q', 'rsync', '-r', '-d', 'gs://bucket/', - '/dir' + '/gsutil_path/gcloud', 'storage', 'rsync', '--recursive', + '--delete-unmatched-destination-objects', 'gs://bucket/', '/dir' ]) def test_rsync_from_disk(self): @@ -84,16 +84,16 @@ def test_rsync_from_disk(self): self.assertTrue(corpus.rsync_from_disk('/dir')) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', '-o', 'GSUtil:parallel_thread_count=16', - '-q', 'rsync', '-r', '-d', '/dir', 'gs://bucket/' + '/gsutil_path/gcloud', 'storage', 'rsync', '--recursive', + '--delete-unmatched-destination-objects', '/dir', 'gs://bucket/' ]) self.mock.cpu_count.return_value = 2 corpus = corpus_manager.GcsCorpus('bucket') self.assertTrue(corpus.rsync_from_disk('/dir')) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', '-q', 'rsync', '-r', '-d', '/dir', - 'gs://bucket/' + '/gsutil_path/gcloud', 'storage', 'rsync', '--recursive', + '--delete-unmatched-destination-objects', '/dir', 'gs://bucket/' ]) def test_upload_files(self): @@ -105,8 +105,8 @@ def test_upload_files(self): self.assertTrue(corpus.upload_files(['/dir/a', '/dir/b'])) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', '-o', 'GSUtil:parallel_thread_count=16', - 'cp', '-I', 'gs://bucket/' + '/gsutil_path/gcloud', 'storage', 'cp', '--read-paths-from-stdin', + 'gs://bucket/' ]) mock_popen.communicate.assert_called_with(b'/dir/a\n/dir/b') @@ -115,7 +115,7 @@ def test_upload_files(self): corpus = corpus_manager.GcsCorpus('bucket') self.assertTrue(corpus.upload_files(['/dir/a', '/dir/b'])) self.assertEqual(self.mock.Popen.call_args[0][0], - ['/gsutil_path/gsutil', '-m', 'cp', '-I', 'gs://bucket/']) + ['/gsutil_path/gcloud', 'storage', 'cp', '--read-paths-from-stdin', 'gs://bucket/']) class RsyncErrorHandlingTest(unittest.TestCase): @@ -247,12 +247,11 @@ def test_rsync_to_disk(self): corpus = corpus_manager.FuzzTargetCorpus('libFuzzer', 'fuzzer') self.assertTrue(corpus.rsync_to_disk('/dir', timeout=60)) self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', - '-m', - '-q', + '/gsutil_path/gcloud', + 'storage', 'rsync', - '-r', - '-d', + '--recursive', + '--delete-unmatched-destination-objects', 'gs://bucket/libFuzzer/fuzzer/', '/dir', ]) @@ -267,21 +266,19 @@ def test_rsync_to_disk_with_regressions(self): self.assertEqual(commands, [ [ - '/gsutil_path/gsutil', - '-m', - '-q', + '/gsutil_path/gcloud', + 'storage', 'rsync', - '-r', - '-d', + '--recursive', + '--delete-unmatched-destination-objects', 'gs://bucket/libFuzzer/fuzzer/', '/dir', ], [ - '/gsutil_path/gsutil', - '-m', - '-q', + '/gsutil_path/gcloud', + 'storage', 'rsync', - '-r', + '--recursive', 'gs://bucket/libFuzzer/fuzzer_regressions/', '/dir/regressions', ], @@ -292,8 +289,8 @@ def test_rsync_from_disk(self): corpus = corpus_manager.FuzzTargetCorpus('libFuzzer', 'fuzzer') self.assertTrue(corpus.rsync_from_disk('/dir')) self.assertEqual(self.mock.Popen.call_args_list[0][0][0], [ - '/gsutil_path/gsutil', '-m', '-q', 'rsync', '-r', '-d', '/dir', - 'gs://bucket/libFuzzer/fuzzer/' + '/gsutil_path/gcloud', 'storage', 'rsync', '--recursive', '--delete-unmatched-destination-objects', + '/dir', 'gs://bucket/libFuzzer/fuzzer/' ]) def test_upload_files(self): @@ -305,7 +302,7 @@ def test_upload_files(self): mock_popen.communicate.assert_called_with(b'/dir/a\n/dir/b') self.assertEqual(self.mock.Popen.call_args[0][0], [ - '/gsutil_path/gsutil', '-m', 'cp', '-I', 'gs://bucket/libFuzzer/fuzzer/' + '/gsutil_path/gcloud', 'storage', 'cp', '--read-paths-from-stdin', 'gs://bucket/libFuzzer/fuzzer/' ])