Skip to content

Commit

Permalink
Revert "Add main to newish ci files (Azure#22380)"
Browse files Browse the repository at this point in the history
This reverts commit 3f31d68.
  • Loading branch information
weshaggard committed Jun 18, 2021
1 parent 3f31d68 commit 0fd8cfd
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 177 deletions.
12 changes: 0 additions & 12 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ jobs:

- template: ../steps/install-reporting-tools.yml

- task: Maven@3
displayName: 'Print security providers'
inputs:
mavenPomFile: 'java-security/demo/pom.xml'
goals: 'compile exec:java'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '11'
jdkArchitectureOption: 'x64'
options: '-Dexec.mainClass="com.example.App"'
publishJUnitResults: false


- ${{ parameters.PreTestSteps }}

- task: PythonScript@0
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/templates/stages/platform-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
},
"matrix": {
"Agent": {
"ubuntu-18.04": { "OSVmImage": "ubuntu-18.04", "Pool": "Azure Pipelines" },
"windows-2019": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" },
"ubuntu-18.04": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" },
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" },
"macOS-10.15": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" }
},
"JavaTestVersion": [ "1.8", "1.11" ],
Expand Down
37 changes: 18 additions & 19 deletions eng/pipelines/templates/steps/initialize-test-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ parameters:
default: client

steps:
- checkout: self
# - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
# parameters:
# Paths:
# - '**/*.xml'
# - 'sdk/${{ parameters.ServiceDirectory }}'
# - ${{ if not(parameters.CheckoutRecordings) }}:
# - '!sdk/**/test-recordings'
# - '!sdk/**/session-records'
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Paths:
- '**/*.xml'
- 'sdk/${{ parameters.ServiceDirectory }}'
- ${{ if not(parameters.CheckoutRecordings) }}:
- '!sdk/**/test-recordings'
- '!sdk/**/session-records'

- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
Expand Down Expand Up @@ -56,14 +55,14 @@ steps:
SDKType: ${{ parameters.SDKType }}
ServiceDirectory: ${{ parameters.ServiceDirectory }}

# - task: PythonScript@0
# displayName: 'Generate directories variable for sparse checkout'
# inputs:
# scriptPath: 'eng/scripts/generate_from_source_pom.py'
# arguments: '--set-pipeline-variable CheckoutDirectories --project-list $(ProjectList)'
# workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: PythonScript@0
displayName: 'Generate directories variable for sparse checkout'
inputs:
scriptPath: 'eng/scripts/generate_from_source_pom.py'
arguments: '--set-pipeline-variable CheckoutDirectories --project-list $(ProjectList)'
workingDirectory: '$(System.DefaultWorkingDirectory)'

# - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
# parameters:
# SkipDefaultCheckout: true
# Paths: $(CheckoutDirectories)
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
SkipDefaultCheckout: true
Paths: $(CheckoutDirectories)
75 changes: 0 additions & 75 deletions java-security/demo/pom.xml

This file was deleted.

27 changes: 0 additions & 27 deletions java-security/demo/src/main/java/com/example/App.java

This file was deleted.

20 changes: 0 additions & 20 deletions java-security/demo/src/test/java/com/example/AppTest.java

This file was deleted.

2 changes: 0 additions & 2 deletions sdk/deviceupdate/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ trigger:
branches:
include:
- master
- main
- hotfix/*
- release/*
paths:
Expand All @@ -16,7 +15,6 @@ pr:
branches:
include:
- master
- main
- feature/*
- hotfix/*
- release/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,30 @@
import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm;
import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm;
import com.azure.security.keyvault.keys.models.JsonWebKey;
import com.azure.security.keyvault.keys.models.KeyCurveName;
//import com.azure.security.keyvault.keys.models.KeyCurveName;
import com.azure.security.keyvault.keys.models.KeyOperation;
import com.azure.security.keyvault.keys.models.KeyVaultKey;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import java.security.InvalidAlgorithmParameterException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
//import java.security.KeyPair;
//import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
import java.security.spec.ECGenParameterSpec;
//import java.security.Provider;
//import java.security.Security;
//import java.security.spec.ECGenParameterSpec;
import java.util.Arrays;
import java.util.HashMap;
//import java.util.HashMap;
import java.util.List;
import java.util.Map;
//import java.util.Map;
import java.util.Random;

import static com.azure.security.keyvault.keys.cryptography.TestHelper.DISPLAY_NAME_WITH_ARGUMENTS;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
//import static org.junit.jupiter.api.Assertions.fail;

public class CryptographyClientTest extends CryptographyClientTestBase {
private KeyClient client;
Expand Down Expand Up @@ -201,7 +202,8 @@ public void signVerifyRsa(HttpClient httpClient, CryptographyServiceVersion serv
@ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
@MethodSource("com.azure.security.keyvault.keys.cryptography.TestHelper#getTestParameters")
public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion serviceVersion) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
initializeKeyClient(httpClient);
// TODO: Uncomment after fixing https://github.com/Azure/azure-sdk-for-java/issues/21677
/*initializeKeyClient(httpClient);
Map<KeyCurveName, SignatureAlgorithm> curveToSignature = new HashMap<>();
curveToSignature.put(KeyCurveName.P_256, SignatureAlgorithm.ES256);
curveToSignature.put(KeyCurveName.P_384, SignatureAlgorithm.ES384);
Expand All @@ -215,9 +217,28 @@ public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion servi
curveToSpec.put(KeyCurveName.P_256K, "secp256k1");
List<KeyCurveName> curveList = Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K);
Provider provider = Security.getProvider("SunEC version 11");
String algorithmName = "EC";
Provider[] providers = Security.getProviders();
Provider provider = null;
for (Provider currentProvider: providers) {
if (currentProvider.containsValue(algorithmName)) {
provider = currentProvider;
break;
}
}
if (provider == null) {
for (Provider currentProvider : providers) {
System.out.println(currentProvider.getName());
}
fail(String.format("No suitable security provider for algorithm %s was found.", algorithmName));
}
for (KeyCurveName crv : curveList) {
final KeyPairGenerator generator = KeyPairGenerator.getInstance("EC", provider);
final KeyPairGenerator generator = KeyPairGenerator.getInstance(algorithmName, provider);
ECGenParameterSpec gps = new ECGenParameterSpec(curveToSpec.get(crv));
generator.initialize(gps);
KeyPair keyPair = generator.generateKeyPair();
Expand All @@ -241,12 +262,13 @@ public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion servi
if (!interceptorManager.isPlaybackMode()) {
assertTrue(verifyStatus);
}
}
}*/
}

@Test
public void signVerifyEcLocal() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
Map<KeyCurveName, SignatureAlgorithm> curveToSignature = new HashMap<>();
// TODO: Uncomment after fixing https://github.com/Azure/azure-sdk-for-java/issues/21677
/*Map<KeyCurveName, SignatureAlgorithm> curveToSignature = new HashMap<>();
curveToSignature.put(KeyCurveName.P_256, SignatureAlgorithm.ES256);
curveToSignature.put(KeyCurveName.P_384, SignatureAlgorithm.ES384);
curveToSignature.put(KeyCurveName.P_521, SignatureAlgorithm.ES512);
Expand All @@ -259,9 +281,28 @@ public void signVerifyEcLocal() throws NoSuchAlgorithmException, InvalidAlgorith
curveToSpec.put(KeyCurveName.P_256K, "secp256k1");
List<KeyCurveName> curveList = Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K);
Provider provider = Security.getProvider("SunEC");
String algorithmName = "EC";
Provider[] providers = Security.getProviders();
Provider provider = null;
for (Provider currentProvider: providers) {
if (currentProvider.containsValue(algorithmName)) {
provider = currentProvider;
break;
}
}
if (provider == null) {
for (Provider currentProvider : providers) {
System.out.println(currentProvider.getName());
}
fail(String.format("No suitable security provider for algorithm %s was found.", algorithmName));
}
for (KeyCurveName crv : curveList) {
final KeyPairGenerator generator = KeyPairGenerator.getInstance("EC", provider);
final KeyPairGenerator generator = KeyPairGenerator.getInstance(algorithmName, provider);
ECGenParameterSpec gps = new ECGenParameterSpec(curveToSpec.get(crv));
generator.initialize(gps);
KeyPair keyPair = generator.generateKeyPair();
Expand All @@ -276,7 +317,7 @@ public void signVerifyEcLocal() throws NoSuchAlgorithmException, InvalidAlgorith
Boolean verifyStatus = cryptoClient.verifyData(curveToSignature.get(crv), plainText, signature).isValid();
assertTrue(verifyStatus);
}
}*/
}

@Test
Expand Down
2 changes: 0 additions & 2 deletions sdk/redisenterprise/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ trigger:
branches:
include:
- master
- main
- hotfix/*
- release/*
paths:
Expand All @@ -15,7 +14,6 @@ pr:
branches:
include:
- master
- main
- feature/*
- hotfix/*
- release/*
Expand Down
2 changes: 0 additions & 2 deletions sdk/storagecache/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ trigger:
branches:
include:
- master
- main
- hotfix/*
- release/*
paths:
Expand All @@ -15,7 +14,6 @@ pr:
branches:
include:
- master
- main
- feature/*
- hotfix/*
- release/*
Expand Down

0 comments on commit 0fd8cfd

Please sign in to comment.