public virtual void SetupRegistry() { registry = new RMRegistryOperationsService("yarnRegistry"); operations = registry; registry.Init(CreateRegistryConfiguration()); registry.Start(); operations.Delete("/", true); registry.CreateRootRegistryPaths(); AddToTeardown(registry); }
public virtual void TestUserZookeeperHomePathAccess() { RMRegistryOperationsService rmRegistryOperations = StartRMRegistryOperations(); string home = rmRegistryOperations.InitUserRegistry(Zookeeper); Describe(Log, "Creating ZK client"); RegistryOperations operations = zookeeperUGI.DoAs(new _PrivilegedExceptionAction_232 (this)); operations.List(home); string path = home + "/subpath"; operations.Mknode(path, false); operations.Delete(path, true); }
// expected // expected /// <summary>Expect a delete operation to fail</summary> /// <param name="operations">operations instance</param> /// <param name="path">path</param> /// <param name="recursive"/> /// <exception cref="System.IO.IOException">An IO failure other than those permitted</exception> public virtual void ExpectDeleteFailure(RegistryOperations operations, string path , bool recursive) { try { operations.Delete(path, recursive); NUnit.Framework.Assert.Fail("should have failed to delete the node " + path); } catch (PathPermissionException) { } catch (NoPathPermissionsException) { } }
public virtual int Rm(string[] args) { Option recursive = OptionBuilder.Create("r"); Options rmOption = new Options(); rmOption.AddOption(recursive); bool recursiveOpt = false; CommandLineParser parser = new GnuParser(); try { CommandLine line = parser.Parse(rmOption, args); IList <string> argsList = line.GetArgList(); if (argsList.Count != 2) { return(UsageError("RM requires exactly one path argument", RmUsage)); } if (!ValidatePath(argsList[1])) { return(-1); } try { if (line.HasOption("r")) { recursiveOpt = true; } registry.Delete(argsList[1], recursiveOpt); return(0); } catch (Exception e) { syserr.WriteLine(AnalyzeException("rm", e, argsList)); } return(-1); } catch (ParseException exp) { return(UsageError("Invalid syntax " + exp.ToString(), RmUsage)); } }