Skip to content

Commit

Permalink
smb multi-channel (#11178)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljian3377 authored Sep 23, 2020
1 parent 5b49d57 commit a3a172b
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 17 deletions.
2 changes: 2 additions & 0 deletions sdk/storage/storage-file-share/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ module.exports = function(config) {
"ACCOUNT_SAS",
"SOFT_DELETE_ACCOUNT_NAME",
"SOFT_DELETE_ACCOUNT_SAS",
"PREMIUM_FILE_ACCOUNT_NAME",
"PREMIUM_FILE_ACCOUNT_SAS",
"TEST_MODE"
],

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions sdk/storage/storage-file-share/review/storage-file-share.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ export interface FileServiceProperties {
cors?: CorsRule[];
hourMetrics?: Metrics;
minuteMetrics?: Metrics;
protocolSettings?: ProtocolSettings;
protocol?: ShareProtocolSettings;
}

// @public
Expand Down Expand Up @@ -1165,11 +1165,6 @@ export interface PipelineOptions {
httpClient?: IHttpClient;
}

// @public
export interface ProtocolSettings {
smbSettings?: SmbSettings;
}

// @public
export interface Range {
count?: number;
Expand Down Expand Up @@ -1705,6 +1700,11 @@ export interface ShareProperties {
remainingRetentionDays?: number;
}

// @public
export interface ShareProtocolSettings {
smb?: ShareSmbSettings;
}

// @public
export class ShareSASPermissions {
create: boolean;
Expand Down Expand Up @@ -1802,6 +1802,11 @@ export type ShareSetQuotaResponse = ShareSetQuotaHeaders & {
};
};

// @public
export interface ShareSmbSettings {
multichannel?: SmbMultichannel;
}

// @public
export interface ShareStats {
shareUsageBytes: number;
Expand All @@ -1828,11 +1833,6 @@ export interface SmbMultichannel {
enabled?: boolean;
}

// @public
export interface SmbSettings {
multichannel?: SmbMultichannel;
}

// @public
export interface SourceModifiedAccessConditions {
sourceIfMatchCrc64?: Uint8Array;
Expand Down
10 changes: 8 additions & 2 deletions sdk/storage/storage-file-share/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ DIR_NAME=<directory name>
# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely.
# TEST_MODE=playback

# Used for share soft delete.
# Optional, used for share soft delete.
SOFT_DELETE_ACCOUNT_NAME=<storage-account-name>
SOFT_DELETE_ACCOUNT_KEY=<storage-account-key>
SOFT_DELETE_STORAGE_CONNECTION_STRING=<storage-account-connection-string>
SOFT_DELETE_ACCOUNT_SAS=<shared-access-signature>
SOFT_DELETE_ACCOUNT_SAS=<shared-access-signature>

# Optional, used for tests on premium file accounts.
PREMIUM_FILE_ACCOUNT_NAME=<storage-account-name>
PREMIUM_FILE_ACCOUNT_KEY=<storage-account-key>
PREMIUM_FILE_STORAGE_CONNECTION_STRING=<storage-account-connection-string>
PREMIUM_FILE_ACCOUNT_SAS=<shared-access-signature>
4 changes: 2 additions & 2 deletions sdk/storage/storage-file-share/src/generatedModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export {
LeaseStateType,
LeaseStatusType,
CopyFileSmbInfo,
ProtocolSettings,
SmbSettings,
ShareProtocolSettings,
ShareSmbSettings,
SmbMultichannel
} from "./generated/src/models";
29 changes: 28 additions & 1 deletion sdk/storage/storage-file-share/test/fileserviceclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
getBSU,
getSASConnectionStringFromEnvironment,
recorderEnvSetup,
getSoftDeleteBSU
getSoftDeleteBSU,
getGenericBSU
} from "./utils";
import { record, delay, Recorder } from "@azure/test-utils-recorder";
import * as dotenv from "dotenv";
Expand Down Expand Up @@ -466,3 +467,29 @@ describe("FileServiceClient", () => {
}
});
});

describe("FileServiceClient Premium", () => {
let recorder: Recorder;
let serviceClient: ShareServiceClient;

beforeEach(function() {
recorder = record(this, recorderEnvSetup);
try {
serviceClient = getGenericBSU("PREMIUM_FILE_");
} catch (error) {
this.skip();
}
});

afterEach(async function() {
await recorder.stop();
});

it("SMB Multichannel", async () => {
await serviceClient.setProperties({
protocol: { smb: { multichannel: { enabled: true } } }
});
const propertiesSet = await serviceClient.getProperties();
assert.ok(propertiesSet.protocol?.smb?.multichannel);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function isBrowser(): boolean {
const mockAccountName = "fakestorageaccount";
const mockAccountKey = "aaaaa";
const mockSDAccountName = "sd-fakestorageaccount";
const mockPFAccountName = "pf-fakestorageaccount";
export const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
// Used in record and playback modes
Expand All @@ -23,7 +24,11 @@ export const recorderEnvSetup: RecorderEnvironmentSetup = {
SOFT_DELETE_ACCOUNT_NAME: `${mockSDAccountName}`,
SOFT_DELETE_ACCOUNT_KEY: `${mockAccountKey}`,
SOFT_DELETE_ACCOUNT_SAS: `${mockAccountKey}`,
SOFT_DELETE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockSDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`
SOFT_DELETE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockSDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`,
PREMIUM_FILE_ACCOUNT_NAME: `${mockPFAccountName}`,
PREMIUM_FILE_ACCOUNT_KEY: `${mockAccountKey}`,
PREMIUM_FILE_ACCOUNT_SAS: `${mockAccountKey}`,
PREMIUM_FILE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockSDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`
},
customizationsOnRecordings: [
// Used in record mode
Expand Down

0 comments on commit a3a172b

Please sign in to comment.