1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+
6+ import * as assert from 'assert' ;
7+ import * as path from 'path' ;
8+ import { shellExec } from './testUtils' ;
9+
10+ const pkg = require ( '../../package.json' ) ;
11+
12+ describe ( 'Dev Containers CLI using Podman' , function ( ) {
13+ this . timeout ( '240s' ) ;
14+
15+ const tmp = path . relative ( process . cwd ( ) , path . join ( __dirname , 'tmp' ) ) ;
16+ const cli = `npx --prefix ${ tmp } devcontainer` ;
17+
18+ before ( 'Install' , async ( ) => {
19+ await shellExec ( `rm -rf ${ tmp } /node_modules` ) ;
20+ await shellExec ( `mkdir -p ${ tmp } ` ) ;
21+ await shellExec ( `npm --prefix ${ tmp } install devcontainers-cli-${ pkg . version } .tgz` ) ;
22+ } ) ;
23+
24+ describe ( 'Command up using Podman' , ( ) => {
25+
26+ it ( 'should execute successfully with valid config with features' , async ( ) => {
27+ const res = await shellExec ( `${ cli } up --docker-path podman --workspace-folder ${ __dirname } /configs/image-with-features` ) ;
28+ const response = JSON . parse ( res . stdout ) ;
29+ assert . equal ( response . outcome , 'success' ) ;
30+ const containerId : string = response . containerId ;
31+ assert . ok ( containerId , 'Container id not found.' ) ;
32+ await shellExec ( `podman rm -f ${ containerId } ` ) ;
33+ } ) ;
34+
35+ it ( 'should execute successfully with valid config with features' , async ( ) => {
36+ const res = await shellExec ( `${ cli } up --docker-path podman --workspace-folder ${ __dirname } /configs/dockerfile-with-features` ) ;
37+ const response = JSON . parse ( res . stdout ) ;
38+ assert . equal ( response . outcome , 'success' ) ;
39+ const containerId : string = response . containerId ;
40+ assert . ok ( containerId , 'Container id not found.' ) ;
41+ await shellExec ( `podman rm -f ${ containerId } ` ) ;
42+ } ) ;
43+ } ) ;
44+ } ) ;
0 commit comments