code: def setup_geoserver(options):
      from geonode.settings import INSTALLED_APPS, OGC_SERVER
      
      # only start if using Geoserver backend
      _backend = os.environ.get('BACKEND', OGC_SERVER['default']['BACKEND'])
      if (_backend == 'geonode.qgis_server'
              or 'geonode.geoserver' not in INSTALLED_APPS):
          return
  
      download_dir = path('downloaded')
      if not download_dir.exists():
          download_dir.makedirs()
  
      geoserver_dir = path('geoserver')
  
      geoserver_bin = download_dir / \
          os.path.basename(dev_config['GEOSERVER_URL'])
      jetty_runner = download_dir / \
          os.path.basename(dev_config['JETTY_RUNNER_URL'])
  
      grab(
          options.get('geoserver', dev_config['GEOSERVER_URL']), geoserver_bin,
          "geoserver binary")
      grab(
          options.get('jetty', dev_config['JETTY_RUNNER_URL']), jetty_runner,
          "jetty runner")
  
      if not geoserver_dir.exists():
          geoserver_dir.makedirs()
  
          webapp_dir = geoserver_dir / 'geoserver'
          if not webapp_dir:
              webapp_dir.makedirs()
  
          print 'extracting geoserver'
          z = zipfile.ZipFile(geoserver_bin, "r")
          z.extractall(webapp_dir)
  
      _install_data_dir()
docs: Prepare a testing instance of GeoServer.