use P4::test; use P4::TM { DATA_DIR => 'self' }; use Data::Dumper; use File::Copy; use Text::Diff; use File::Copy::Recursive 'dircopy'; `p4 configure set server.extensions.allow.unsigned=1`; `p4 configure set exts=5`; `p4 user -o sampleExtensionsUser | p4 user -i -f`; `p4 user -o alice | p4 user -i -f`; `p4 user -o bob | p4 user -i -f`; `p4 user -o charlie | p4 user -i -f`; `p4 user -o diane | p4 user -i -f`; dircopy $script_abspath =~ s/\.t$//r . '/*', 'narrow_workspace_mappings'; `p4 extension --package narrow_workspace_mappings`; `p4 extension --install narrow_workspace_mappings.p4-extension -y`; `p4 extension --configure ExampleInc::narrow_workspace_mappings -o | p4 extension --configure ExampleInc::narrow_workspace_mappings -i`; $stdin = `p4 extension --configure ExampleInc::narrow_workspace_mappings --name SpecViewCheck-instance -o`; $stdin =~ s#insert minimum number of level across all#2#g; $stdin =~ s/Space-separated list of which users do NOT have this restriction/alice bob charlie/g; `p4 extension --configure ExampleInc::narrow_workspace_mappings --name SpecViewCheck-instance -i`; # validate diane is restricted tm `p4 -u diane client -o | p4 -u diane client -i`; ( $stdin = `p4 -u diane client -o` ) =~ s://.*::gm; $stdin .= " //depot/project1/release1/... //ws0/p1/...\n"; tm `p4 -u diane client -i`; # delete the client and start over tm `p4 -u diane client -d ws0`; # validate bob can do what he wants tm `p4 -u bob client -o | p4 -u bob client -i`; tm `p4 -u bob client -d ws0`; # validate alice can do what she wants as well tm `p4 -u alice client -o | p4 -u alice client -i`; #diag 'stdout: '.Dumper $server->getSTDOUT; #diag 'stderr: '.Dumper $server->getSTDERR; __DATA__ [[28,32,35,38,40,43], [ 'p4 -u diane client -o | p4 -u diane client -i', ' Error in client specification. \'SpecViewCheck-instance\' validation failed: narrow_workspace_mappings/22BB3349-4AD5-8617-203B-57574701EB79/2019.1 GA: For line //depot/... //ws0/..., not specific enough, only 1 directory level when 2 needed ', 1, 'p4 -u diane client -i', 'Client ws0 saved. ', 0, 'p4 -u diane client -d ws0', 'Client ws0 deleted. ', 0, 'p4 -u bob client -o | p4 -u bob client -i', 'Client ws0 saved. ', 0, 'p4 -u bob client -d ws0', 'Client ws0 deleted. ', 0, 'p4 -u alice client -o | p4 -u alice client -i', 'Client ws0 saved. ', 0 ] ]
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 30809 | C. Thomas Tyler |
Code drop with newer versions of Extensions. Thanks to @jason_gibon. #review-30810 @jabson_gibson |
||
#1 | 30808 | C. Thomas Tyler |
Promoted from 2019.1/... to main/... |
||
//guest/perforce_software/extensions/2019.1/narrow_workspace_mappings.t | |||||
#1 | 25601 | Jason Gibson |
Import example Extensions. p19.1@1797741 |